Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hopefully I'm wording this correctly.
I have a dataset that is looking at students who registered for classes on time. I have a column for each registration term. I produced individual visuals like the ones shown here:
Ideally, I'd like to display these on a single visual to make for better readability since our goal is to compare the percentage of students who registered on time by term. When I attempt to place them on a single visual, it calculates the percentages by the grand total. But ideally, I want SP2022 to calculate to 100% and so on for SP2023 and SP2024. Below is an example of what is occurring.
Any tips on how I can accomplish this?
Solved! Go to Solution.
Hi @mljones
Based on the screenshots you provided, your issue seems to be that individual visuals aren't grouped by semester to calculate percentages.
Based on my guess, it may be that you chose "Percent of grand total", which doesn't group the data, but instead calculates the percentage after summing.
You'll need to create measures manually, and here's how we do it:
Here's some dummy data
You can create a measure like this, which groups and sums your semesters and then calculates the percentages
result = var total_number_m = CALCULATE(SUM(Sheet1[Number of students]), FILTER(ALL('Sheet1'), [semester] = max(Sheet1[semester])))
var number_of_student = SELECTEDVALUE('Sheet1'[Number of students])
return DIVIDE(number_of_student, total_number_m)
The default is an integer type, and you need to change measure to a percentage type
Here is the result
Best Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mljones
Based on the screenshots you provided, your issue seems to be that individual visuals aren't grouped by semester to calculate percentages.
Based on my guess, it may be that you chose "Percent of grand total", which doesn't group the data, but instead calculates the percentage after summing.
You'll need to create measures manually, and here's how we do it:
Here's some dummy data
You can create a measure like this, which groups and sums your semesters and then calculates the percentages
result = var total_number_m = CALCULATE(SUM(Sheet1[Number of students]), FILTER(ALL('Sheet1'), [semester] = max(Sheet1[semester])))
var number_of_student = SELECTEDVALUE('Sheet1'[Number of students])
return DIVIDE(number_of_student, total_number_m)
The default is an integer type, and you need to change measure to a percentage type
Here is the result
Best Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you!
Hi @mljones
It seems possible with dynamic measures (using selectedvalue function).
For more specific suggestions provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
User | Count |
---|---|
77 | |
75 | |
46 | |
31 | |
28 |
User | Count |
---|---|
99 | |
91 | |
51 | |
49 | |
46 |