Forum Discussion

harirao's avatar
harirao
Icon for Post Prodigy rankPost Prodigy
2 years ago
Solved

Percentage Row Total not working for 100% Stacked Column Chart

Hi Team,


I am working on a 100% Stacked Column Chart where I want to see the percentage of each quarter along with the Geography breakdown. In the Matrix table, I am getting exactly 100% (sum of APJ, AMS, & EMEA) for each quarter (see the screenshot below for reference).




However, when I use the same Matrix data in the 100% Stacked Column Chart, the total for each quarter shows diffrent percentage and it automatically adjusts to the Percentage of Grand Total (screenshot attached for reference).



Could you please suggest a solution to resolve this issue?


Thank you.

 

  • harirao 


    That's a basic method to calculate percentage, this might change depending on you logic. If you have issues using this, please share a sample file or logic along with column names.


    Perct=

    Var overall = CALCULATE(sum(sales),all('Table'))

    return DIVIDE(sum(sales),overall,0)

    Don't forget to change the data type to percentage for this measure.

    If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

    Follow me on LinkedIn!!!

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi harirao ,
    Thanks for  NaveenGandhi reply.

    You can try measure below

    Measure = 
    VAR a = SUM('Table'[Value])
    VAR b = 
    CALCULATE(
        SUM('Table'[Value]),
        ALLEXCEPT(
            'Table',
            'Table'[Qtr]
        )
    )
    RETURN
    a/b

    Final output

     

    Best regards,
    Albert He


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

     

4 Replies

  • NaveenGandhi's avatar
    NaveenGandhi
    Icon for Memorable Member rankMemorable Member

    Hi harirao 

    This issue might be due to the decimal palces under datalabel->detail->value decimal places.  try chaning this to 2 places.

    Also try to create the percent calculation as a measure and mark it as percentage data type, That's the best practice you can follow.

    If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

    Follow me on LinkedIn!!!

    • harirao's avatar
      harirao
      Icon for Post Prodigy rankPost Prodigy

      Hi NaveenGandhi 

      As mentioned, I tried changing it to 2 decimal places. Please see the screen print below for your reference.


      Could you please share a sample DAX measure for the "Percent Calculation"?

      Thank you

      • NaveenGandhi's avatar
        NaveenGandhi
        Icon for Memorable Member rankMemorable Member

        harirao 


        That's a basic method to calculate percentage, this might change depending on you logic. If you have issues using this, please share a sample file or logic along with column names.


        Perct=

        Var overall = CALCULATE(sum(sales),all('Table'))

        return DIVIDE(sum(sales),overall,0)

        Don't forget to change the data type to percentage for this measure.

        If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

        Follow me on LinkedIn!!!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi harirao ,
    Thanks for  NaveenGandhi reply.

    You can try measure below

    Measure = 
    VAR a = SUM('Table'[Value])
    VAR b = 
    CALCULATE(
        SUM('Table'[Value]),
        ALLEXCEPT(
            'Table',
            'Table'[Qtr]
        )
    )
    RETURN
    a/b

    Final output

     

    Best regards,
    Albert He


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly