Forum Discussion
Quick Measure Calculate difference from another row
Hi there, i am trying to use quick measure for the first time as i thought this functionality could help me out on this occasion. I have one dataset containing various economic indicator times series for many different countries.
I want to take economic indicator A for Country US and calculate the difference compared with Country EU.
Any ideas please as the result i get is zero?
Thanks in advance
Hi sebbyp,
Replace DIVIDE with your formula. For example.
Measure 5 = VAR US = CALCULATE ( SUM ( 'Table1'[Macro Trend Score] ), 'Table1'[Country] = "US" ) VAR EU = CALCULATE ( SUM ( Table1[Macro Trend Score] ), 'Table1'[Country] = "EU" ) RETURN US - EUBest Regards!
Dale
5 Replies
- v-jiascu-msftMicrosoft Employee
Hi sebbyp,
Try this formula please.
Measure = VAR US = CALCULATE ( SUM ( 'Table1'[Macro Trend Score] ), 'Table1'[Country] = "US" ) VAR EU = CALCULATE ( SUM ( Table1[Macro Trend Score] ), 'Table1'[Country] = "EU" ) RETURN DIVIDE ( us, eu, 0 )Best Regards!
Dale
- sebbypHelper III
v-jiascu-msftthank you for the help. I see your formula works but you have used the divide function when i was looking for the difference between the two results. What should i replace DIVIDE with to get a subtraction? for example US - EU?
- v-jiascu-msftMicrosoft Employee
Hi sebbyp,
Replace DIVIDE with your formula. For example.
Measure 5 = VAR US = CALCULATE ( SUM ( 'Table1'[Macro Trend Score] ), 'Table1'[Country] = "US" ) VAR EU = CALCULATE ( SUM ( Table1[Macro Trend Score] ), 'Table1'[Country] = "EU" ) RETURN US - EUBest Regards!
Dale