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.
HI there,
I need to calculate the percentage of total. I am using crime stats data set which i got from the internet.
I created a new field
Solved! Go to Solution.
Hi @Anonymous
You can create a measure like below
Measure 3 = DIVIDE( [Total crime %], CALCULATE( [Total crime %], -- ALL('Crime Stats Files') ) )
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You can create a measure like below
Measure 3 = DIVIDE( [Total crime %], CALCULATE( [Total crime %], -- ALL('Crime Stats Files') ) )
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Mariusz
Thanks for replying.
i have tried your measure but it gives me 98% and not 100%. I have not filtered anything
Hi @Anonymous
Are you sure you don't have any filters applied (page level or report level), ALL() Ignores all filters so there must be something applied
Many Thanks
Mariusz
Hi Mariusz,
Sorry about that i did have a filter applied to the page which is rather strange as i never applied it. Your formula works thanks.
I did make an adjustment to your formula as Chris mentioned which was to use the ALLEXCEPT function as i did not want the year filter to affect the percentage total.
Hi, I hade the same question today.
try this:
Total crime % = ('Crime Stats Files'[Crime Count])/CALCULATE('Crime Stats Files'[Crime Count];ALLSELECTED())
Hi
We tried this. However, if you click on a borough to filter it, it alwways shows 100%. You kind of want it as a percentage of "ALL NOT SELECTED", except for the year.
Regards
Chris
Total crime % = ('Crime Stats Files'[Crime Count])/CALCULATE('Crime Stats Files'[Crime Count];ALL())
Hi
You need to calculate it as crime count / (all, except for the year selection).
You can use the ALLEXCEPT function as per below:
https://docs.microsoft.com/en-us/dax/allexcept-function-dax
The example here is pretty much the same challenge you are facing.
Regards
Chris
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 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |