Forum Discussion

amk0592's avatar
amk0592
New Member
6 years ago
Solved

Power Bi formula for % Average

Need Help,

 

As seen in below table, i want to have a graph with % wastage value month vise of different materials. Power bi takes average of % wastage and then gives me total wastage value of 26.1% which is not right as its taking average of % values. I want to take sum of zero based consumption and sum of zb wastage absolute and then divide and take % which will give me correct % wastage value. How to do it? so that i just select any month and it gives me % wastage value for all materials in that month

 

MonthMaterialZero based consumptionZB wastage absolute% Wastage
JanMaterial A                                                                    1,680,439                           347,00621%
JanMaterial B                                                                    3,124,885                           542,49517%
JanMaterial C                                                                        284,719                            (13,224)-5%
FebMaterial A                                                                        404,114                           159,34739%
FebMaterial B                                                                        305,169                             67,21922%
FebMaterial C                                                                        716,636                           440,62961%
 Sum                                                                     6,515,963                        1,543,472 
   Total Wastage (%) 24% (correct value)26.1%

 

  • Hi, this sounds like a DAX problem and not a power query. I'm not quite sure about the formula because it was confusing.

    However you can try this for a New Measure in DAX:

     

    % value = 
    DIVIDE (
        SUM(Table[ZB wastage absolute]),
        SUM(Table[Zero based consumption]),
        0
    )

     

    Hope this helps, 

3 Replies

  • Hi, this sounds like a DAX problem and not a power query. I'm not quite sure about the formula because it was confusing.

    However you can try this for a New Measure in DAX:

     

    % value = 
    DIVIDE (
        SUM(Table[ZB wastage absolute]),
        SUM(Table[Zero based consumption]),
        0
    )

     

    Hope this helps, 

    • amk0592's avatar
      amk0592
      New Member
      dear i have updated my question for details, please review again
      • ibarrau's avatar
        ibarrau
        Super User

        Have you tried the DAX formula for a new measure? I have updated to match the column names.