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
Go to Solution.
You can create a measure like below
Measure 3 =
[Total crime %],
[Total crime %], --
ALL('Crime Stats Files')
Regards,MariuszIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 appliedMany ThanksMariusz
Hi, I hade the same question today.
Total crime % = ('Crime Stats Files'[Crime Count])/CALCULATE('Crime Stats Files'[Crime Count];ALLSELECTED())
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.
Total crime % = ('Crime Stats Files'[Crime Count])/CALCULATE('Crime Stats Files'[Crime Count];ALL())
You need to calculate it as crime count / (all, except for the year selection).
You can use the ALLEXCEPT function as per below:
The example here is pretty much the same challenge you are facing.
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.
Engage and empower students with Power BI!
Continue your learning in our online communities.
Travel to Melbourne and network with thousands of peers!
Check out what's new in the Power BI Community!