Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I want to calculate the difference between a year's value and the mean value over all years as modulus.
Values:
2013: 300
2014: 170
2015: 250
2016: 320
Mean:
260
What I want to display in a table is:
2013 40
2014 90
2015 10
2016 60
I do not have my values as a column, actually, it is a measure which lists the values per year in a table visualization. The year is a column in a table and the value is a calculated measure connected the the same table.
Another problem I encountered is that the mean changes if I use a slicer and I don't get this to work properly. Does anyone have an idea how to achieve this?
Thanks in advance
xuri
Solved! Go to Solution.
Something along these lines:
Difference = ABS ( AVERAGEX ( ALLSELECTED ( TheTable[Year] ), [The Measure] ) - [The Measure] )
Hi @xuri,
Taking into account that you need to have a average of the measure you can add this measure:
Difference = [Total values] - AVERAGEX(ALL(Years[Year]),[Total values])
If you want you can make the second part a easure by itself and call it mean and the do Total Values - Mean.
Final result is below:
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank you for the quick response! Both solutions worked perfectly!
Hi @xuri,
Taking into account that you need to have a average of the measure you can add this measure:
Difference = [Total values] - AVERAGEX(ALL(Years[Year]),[Total values])
If you want you can make the second part a easure by itself and call it mean and the do Total Values - Mean.
Final result is below:
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsSomething along these lines:
Difference = ABS ( AVERAGEX ( ALLSELECTED ( TheTable[Year] ), [The Measure] ) - [The Measure] )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |