Forum Discussion
Anonymous
4 years agoNot applicable
Average Total for a Measure
Hello - for the measure 'diff_v1_v2', I want to see the difference between Value 1 & 2 when there's context, but for the totals line, I want to see the average of the difference for the rows with con...
- 4 years ago
Anonymous,
You can create a SWITCH statement that detects which level of Date Table is being used. You'll have to code each scenario in the SWITCH statement. This is an example of how you can modify AVERAGEX:
AVERAGEX ( VALUES ( 'Date Table'[FYFW] ), [Value 2] - [Value 1] )The article below describes the differences between ISINSCOPE and HASONEVALUE. Be sure to understand the differences so you can use the appropriate function.
https://www.sqlbi.com/articles/distinguishing-hasonevalue-from-isinscope/
Anonymous
4 years agoNot applicable
GOT IT DataInsights ! Thank you for the article concerning ISINSCOPE vs HASONEVALUE, that is something new for me. I did one test with the SWITCH function and this will get me what I need. Much obliged!
DataInsights
4 years agoSuper User
Excellent!