Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello
I have some data on patients and how many days they stayed in a hospital.
If a patient has been in the hospital for 3 days (starting with day zero) like patient P110001121288 then I have three rows. One row (observation) for each day in the hospital - all starting with zero and incrementing by 1.
Data look like this:
PatientId DaysInHospital AgeGroups
P110001121288 0 0-29 years
P110001121288 1 0-29 years
P110001121288 2 0-29 years
P110006104217 0 60+ years
P110006104217 1 60+ years
P110006104217 2 60+ years
P110006104217 3 60+ years
P110006319740 0 30-59 years
P110006319740 1 30-59 years
P110006319740 2 30-59 years
P110006319740 3 30-59 years
P110006319740 4 30-59 years
P110006319740 5 30-59 years
P110006593041 0 30-59 years
P110006593041 1 30-59 years
P110006593041 2 30-59 years
P110006593041 3 30-59 years
P110006670979 0 30-59 years
P110006670979 1 30-59 years
P110006670979 2 30-59 years
P110006670979 3 30-59 years
P110006670979 4 30-59 years
P110008686937 0 0-29 years
P110008751176 0 0-29 years
P110008751176 1 0-29 years
P110008751176 2 0-29 years
P110008751176 3 0-29 years
P110008751176 4 0-29 years
P110008751176 5 0-29 years
P110008751176 6 0-29 years
P110008751176 7 0-29 years
P110008751176 8 0-29 years
My graph looks like this - however I want to show percentages per group instead of totals, so I need the graph to start with 100% for day zero for each agegroup. And then I need to calculate a measure for the percentages for the following days, which means I need to use the numbers from day zero as denominator. E.g 30-59 years denominator = 669 and the percentage for day 1 should be 444/669 = 66,4% and so forth for each group.
How to calculate the DAX measure for these percentages?
Thank you very much in advance!
Solved! Go to Solution.
I believe this measure will do what you are looking for.
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
I believe this measure will do what you are looking for.
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 14 | |
| 7 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 23 | |
| 10 | |
| 10 | |
| 6 | |
| 5 |