Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I am trying to calculate new measure as a deviation of individual ratio from the overall average ratio across all individuals. It will be displayed in a bar chart and the number of rows will depend on some other attribute slicers so it needs to be a measure so that it can change dynamically.
Example data:
Person | home_p xxx | 1 xxx | 0 xxx | 1 xxx | 0 xxx | 1 yyy | 1 yyy | 1 yyy | 1 yyy | 1 yyy | 1 aaa | 1 aaa | 1 aaa | 1 bbb | 0 bbb | 0 bbb | 0
The first part is simple
home_p_rate = SUM('score'[home_p])/COUNT('score'[home_p])
which gives me the individual ratios in the bar chart.
Now I need to add something like this to get the deviance from overall average:
home_p_rate_dev = SUM('score'[home_p])/COUNT('score'[home_p]) - AverageAcrossAllIndividuals( SUM('score'[home_p])/COUNT('score'[home_p]) )
Any idea how to approach this?
Thanks
Jonas
Solved! Go to Solution.
In this scenario, you can use below measure formula to get the deviance from overall average.
home_p_rate_dev = VAR AverageAcrossAllIndividuals = CALCULATE ( AVERAGE ( score[home_p] ), ALL ( score ) ) RETURN ( [home_p_rate] - AverageAcrossAllIndividuals )
Best Regards,
Herbert
In this scenario, you can use below measure formula to get the deviance from overall average.
home_p_rate_dev = VAR AverageAcrossAllIndividuals = CALCULATE ( AVERAGE ( score[home_p] ), ALL ( score ) ) RETURN ( [home_p_rate] - AverageAcrossAllIndividuals )
Best Regards,
Herbert
Very simple and nice solution. Thank you!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
78 | |
57 | |
37 | |
34 |
User | Count |
---|---|
99 | |
56 | |
56 | |
46 | |
40 |