Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Cluster Column Chart Not calculating percent of string variable by x-axis correctly

Hello, 

 

I searched this forum, but I could not find anything that solved my issue. I have a matrix table with the count of two different categories by year. If I add my value and show as "pecent of column", it gives me the correct percentage. When I add this to a clustered column chart, it does not give me the correct percentage. Please help! 

 

Measure = DIVIDE(

COUNT(DISP_HISTORY[CD Count]),
CALCULATE(COUNT(DISP_HISTORY[CD Count]), ALLEXCEPT(DISP_HISTORY, DISP_HISTORY[Start of Week])))
 
A 2019 Should be 0%
B 2019 should be 100%
 
A 2020 should be 3%
B 2020 should be 97%
 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    I figured it out. 

     

    The measure I needed was: 

     

    Measure = DIVIDE(

    COUNT(DISP_HISTORY[CD Count]),
    CALCULATE(COUNT(DISP_HISTORY[CD Count]), AllSelected (DISP_HISTORY[CD Count)))

3 Replies

  • Anonymous 

    Try one of the following meassures:

     

    Measure = 
    DIVIDE(
        COUNT(DISP_HISTORY[CD Count]),
        CALCULATE(
            COUNT(DISP_HISTORY[CD Count]), 
            ALLSELECTED(DISP_HISTORY[Start of Week])
        )
    )
    Measure = 
    DIVIDE(
        COUNT(DISP_HISTORY[CD Count]),
        CALCULATE(
            COUNT(DISP_HISTORY[CD Count]), 
            ALLSELECTED(DISP_HISTORY[Year])
        )
    )

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you. The first measure gives me 100% for all columns. 

       

      The second measure gives me the percentage by legand (CD Count) rather than Axis (year) 

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    I figured it out. 

     

    The measure I needed was: 

     

    Measure = DIVIDE(

    COUNT(DISP_HISTORY[CD Count]),
    CALCULATE(COUNT(DISP_HISTORY[CD Count]), AllSelected (DISP_HISTORY[CD Count)))