Forum Discussion

dbarseg1's avatar
dbarseg1
Frequent Visitor
2 years ago
Solved

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's avatar
    aduguid
    Icon for Memorable Member rankMemorable 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
    )
    • aduguid's avatar
      aduguid
      Icon for Memorable Member rankMemorable Member

      Glad to hear. Can you please accept it as the solution? 😀