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.
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.
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 |
---|---|
46 | |
28 | |
22 | |
12 | |
8 |
User | Count |
---|---|
76 | |
53 | |
46 | |
16 | |
12 |