Forum Discussion
dbarseg1
2 years agoFrequent Visitor
Percentage and value data label for clustered column chart
Hi everyone,
I'm new to DAX and writing measures. Below, I want the light blue and dark blue columns to show what percentage of their time cluster they account for. So for example, for 2019, the light blue to show %=137/(137+88.7). This measure needs to adjust as the user drills down to more granular time periods as well-- like quarters, months, and weeks. Essentially, i want each column to have a percent that divides its value by the sum of its cluster.
Here is the DAX measure I have now... not sure if i'm on the right track. Any help is appreciated!!
Hosp/PP % =
DIVIDE(
CALCULATE(
SUM('BSF Files'[12. Sum of Extended Price]),
ALLSELECTED('BSF Files'[08. Hosp/PP]),
VALUES('BSF Files'[05. G/L Date])
),
CALCULATE(
SUM('BSF Files'[12. Sum of Extended Price]),
ALLSELECTED('BSF Files'[05. G/L Date])
),
0
)
try this measure
Hosp/PP % = DIVIDE( SUM('BSF Files'[12. Sum of Extended Price]), CALCULATE( SUM('BSF Files'[12. Sum of Extended Price]), ALLSELECTED('BSF Files'[08. Hosp/PP]) ), 0 )
3 Replies
- aduguid
Memorable Member
try this measure
Hosp/PP % = DIVIDE( SUM('BSF Files'[12. Sum of Extended Price]), CALCULATE( SUM('BSF Files'[12. Sum of Extended Price]), ALLSELECTED('BSF Files'[08. Hosp/PP]) ), 0 ) - dbarseg1Frequent Visitor
It worked! Thank you so much!
- aduguid
Memorable Member
Glad to hear. Can you please accept it as the solution? 😀