Forum Discussion

AtchayaP's avatar
AtchayaP
Helper V
4 years ago
Solved

Dax

Name.             Value 

Xxx.                 1806

Yyy.                    341

Zzz.                    236

 

This is my table I want to calculate %of value using dax..can anyone let me know how to calculate 

  • Seanan's avatar
    Seanan
    4 years ago

    Hi AtchayaP 

    Could you try this instead (I replaced the ALL('Table (2)' [Name]), with [Value])

    PercGT = DIVIDE(SUM('Table (2)'[Value]),CALCULATE(SUM('Table (2)'[Value]),ALL('Table (2)'[Value])))

    In my test envrionment this has worked for me.

  • Hi AtchayaP 

    Thanks for reaching out to us.

    You can try this measure

    % = DIVIDE(MIN('Table'[Value]),SUMX(ALL('Table'),'Table'[Value]))

    in this measure,  MIN('Table'[Value]) will return the value of current row, SUMX(ALL('Table'),'Table'[Value]) will return the total= 1806+341+236.

    so for row 1, %= divide(1806, (1806+341+236)) = 0.76, then you can format it as percentage by clicking on % button.

    Best Regards,

    Community Support Team _Tang

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

7 Replies

  • Seanan's avatar
    Seanan
    Solution Supplier

    Hi AtchayaP 

    You can use this measure to get the grant total percentage value

    PercGT = DIVIDE(SUM('Table (2)'[Value]),CALCULATE(SUM('Table (2)'[Value]),ALL('Table (2)'[Name])))
      • Seanan's avatar
        Seanan
        Solution Supplier

        Hi AtchayaP 

        Could you try this instead (I replaced the ALL('Table (2)' [Name]), with [Value])

        PercGT = DIVIDE(SUM('Table (2)'[Value]),CALCULATE(SUM('Table (2)'[Value]),ALL('Table (2)'[Value])))

        In my test envrionment this has worked for me.

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi AtchayaP 

    Thanks for reaching out to us.

    You can try this measure

    % = DIVIDE(MIN('Table'[Value]),SUMX(ALL('Table'),'Table'[Value]))

    in this measure,  MIN('Table'[Value]) will return the value of current row, SUMX(ALL('Table'),'Table'[Value]) will return the total= 1806+341+236.

    so for row 1, %= divide(1806, (1806+341+236)) = 0.76, then you can format it as percentage by clicking on % button.

    Best Regards,

    Community Support Team _Tang

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

  • In the visualizations pain change Total  value to 'show value as percenetage of grand total'