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.
Just starting out with Power BI and really loving it. I currently have a page that is pointing to demographic cube data and have a pie chart displaying race numbers. I would like those numbers changed to percentages and in doing research I see that I should create a new column or a new measure. I am trying to use the DIVIDE method, but keep getting an error. Can someone offer me direction or help with this? I wish there was an option in the data labels to just display the number as a percent. Here is the DAX that I have that is not working: RacePercentage = DIVIDE(count(Demographics[Race1.Race Name1]), all(Demographics[Clients Served Count]))
Thanks for the help and advice
Solved! Go to Solution.
Hi @Anonymous. Welcome to Power BI!
You're correct that there is no option to display the data labels as a percentage, though the tips that show on hover will show the percent. If you really want them on the data labels, though, you're on the right track with the workaround.
When starting out with DAX, it can be helpful to use building blocks and test those at each level, to know if each piece is working. I'm not sure from what you described which fields to use, as there are two different fields used in the DIVIDE. Typically, you'd want to divide the individual count by the whole count, using the same fields. An example:
Data
Name Score
KGrice 3
guyinkalamazoo 5
Measures:
Score Sum = SUM(TableName[Score])
Total Score = CALCULATE([Score Sum], ALL(TableName[Name]))
Score Percent = DIVIDE([Score Sum], [Total Score])
Be sure to format Score Percent as a Percentage. With the measure selected in Fields, go to the Modeling tab and click the % button.
And here are two pie charts using these measures. The one on the left uses Score Sum in the Values section, and the one on the right uses Score Percent.
You can also vote on the idea here to do this natively without the extra measure.
Hi @Anonymous. Welcome to Power BI!
You're correct that there is no option to display the data labels as a percentage, though the tips that show on hover will show the percent. If you really want them on the data labels, though, you're on the right track with the workaround.
When starting out with DAX, it can be helpful to use building blocks and test those at each level, to know if each piece is working. I'm not sure from what you described which fields to use, as there are two different fields used in the DIVIDE. Typically, you'd want to divide the individual count by the whole count, using the same fields. An example:
Data
Name Score
KGrice 3
guyinkalamazoo 5
Measures:
Score Sum = SUM(TableName[Score])
Total Score = CALCULATE([Score Sum], ALL(TableName[Name]))
Score Percent = DIVIDE([Score Sum], [Total Score])
Be sure to format Score Percent as a Percentage. With the measure selected in Fields, go to the Modeling tab and click the % button.
And here are two pie charts using these measures. The one on the left uses Score Sum in the Values section, and the one on the right uses Score Percent.
You can also vote on the idea here to do this natively without the extra measure.
Thanks for the information and the welcome! I did also see this in the link for the vote that you just sent and it is EXACTLY what I needed
" this is actually technically already a thing? if you go to values, and open the drop down and select quick calc, and change the 'show value as' field to % of grand total."
I'm glad that worked for you. I saw the Quick Calc option before posting, but when I tried to test it, I get an Unexpected Error. Seems to happen to me every time, so I sent a frown with feedback.
UPDATE: Apparently I wasn't on the latest version and it's fixed there. Updated my version and no longer have issues using that method.
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |