cancel
Showing results for
Did you mean:
bflaviu Frequent Visitor

## Using a Single Value for Part of a Measure Based on Lookup

I need to do something that seems simple, but I can't seem to figure it out.  I want to create a measure that compares some aggregates to a single value from another table.  For example, I have two tables:  Orders and CSR Goals.  The Orders table has a Order Value column and a CSR column.  The CSR Goals has only two columns:  CSR and Goal.  They are tied on CSR.  Now, I want a simple measure that gives me a Percent(%) to Sales Goal by using the SUM('Orders'[OrderValue])/<GOAL>, where <GOAL> is the value in CSR Goals in the current context.

Another way to think of it is I need a KPI that tells me if they sold above or below their goal.  I can do everything up to the point where I need it to compare to the goal.  I have 5 sales people, and each one has an arbritray goal value, which I have in a table.  I need to measure to use that value in the calculation.

In the example in the images below, I showed "conceptually" what I need my calculation to do.  I"m starting to feel crazy because I can write a measure that simply divides a sum by a single number like SUM(Values)/5.  All I'm asking is instead of me writing "5", I need that single number to be pulled from a table that says that number should be "5". 3 REPLIES 3
Ross73312 Super Contributor

## Re: Using a Single Value for Part of a Measure Based on Lookup

Seems to me like you just need use

```DIVIDE(
SUM('Orders'[OrderValue]),
SUM('CSR Goals'[Goal])
)```

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

bflaviu Frequent Visitor

## Re: Using a Single Value for Part of a Measure Based on Lookup

@Ross73312 wrote:

Seems to me like you just need use

```DIVIDE(
SUM('Orders'[OrderValue]),
SUM('CSR Goals'[Goal])
)```

Technically that would work in this simple scenario.  But the concept still eludes me for when I need something a bit more complex.  I was trying to post the most basic example to try to understand the concept of pulling a single value from a similar table.  I'm actually facing a situation where some of the CSR goals are hard-coded like in this example, but others have another measure, like SUM of sales of their customers last year plus 10%.  So my Goals table might have a column like "Needs Override" that's true or false (1,0) and the "Override Goal".  So the measure would be more like:

```DIVIDE(
SUM('Orders'[OrderValue]),
IF('CSR Goals'[NeedsOverride]=1,'CSR'[Goal],[Sales Last Year])
)```

Where [Sales Last Year] is already the main goal measure.

Ross73312 Super Contributor

## Re: Using a Single Value for Part of a Measure Based on Lookup

In that case, if certain goals are calculated, would it be more sensible to forward load that calculation by calculating the goals ahead of time and storing it in a table.

This could be making a new table that either draws through the existing value, or if the existing value is flagged, it calculates a new table.

If your data has multiple financial years, where you need the goals for each year, you could also assign financial years to this new goal table.

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Announcements #### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform. Top Kudoed Authors
Users Online
Currently online: 56 members 1,382 guests
Recent signins:
• az • Bquinn • jackwaayer • SnowAus • danextian • RaulChoque • DataUser88 • AnnieMcC • Bobbertsan • arvshar2 • Souza • Ifeanyi • jdd90 • pcand01
{"ft_lang_label":"__label__en","ft_lang_prob":0.9448526,"math_prob":0.7352983,"size":2910,"snap":"2019-35-2019-39","text_gpt3_token_len":682,"char_repetition_ratio":0.11562285,"word_repetition_ratio":0.034883723,"special_character_ratio":0.2353952,"punctuation_ratio":0.09045226,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9645327,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"im_url_duplicate_count":[null,null,null,1,null,1,null,null,null,null,null,null,null,1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-15T23:31:55Z\",\"WARC-Record-ID\":\"<urn:uuid:12f11f2c-d556-43fc-9d8b-10f461806373>\",\"Content-Length\":\"603130\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:65b774ca-8ca4-4402-ae8f-0332931a4a33>\",\"WARC-Concurrent-To\":\"<urn:uuid:b7143997-5319-4e83-88cd-5f34d911e5d9>\",\"WARC-IP-Address\":\"208.74.205.170\",\"WARC-Target-URI\":\"https://community.powerbi.com/t5/Desktop/Using-a-Single-Value-for-Part-of-a-Measure-Based-on-Lookup/td-p/312086\",\"WARC-Payload-Digest\":\"sha1:RO3Z3LU627JZWMCPPXYE5YP4556YZQ63\",\"WARC-Block-Digest\":\"sha1:DQER3VC3ANAYDG2OPHQOH55GEOHECSUV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514572436.52_warc_CC-MAIN-20190915215643-20190916001643-00138.warc.gz\"}"}