Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
amk0592
New Member

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%

 

1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

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, 


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

Happy to help!

LaDataWeb Blog

View solution in original post

3 REPLIES 3
ibarrau
Super User
Super User

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, 


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

Happy to help!

LaDataWeb Blog

dear i have updated my question for details, please review again

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


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

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.