Forum Discussion

danish169's avatar
danish169
Icon for Helper I rankHelper I
4 years ago
Solved

Day Grouping Weighted Average

Hello experts, 

 

Having a problem with the following dataset of orders - the order id's are nested under the day of the month:

 

 

I need to work out the average market unit rate by calculating a weighted average depending on the qty sold. 

 

So far I can calculated out the contribution of each row in the final column yet this doesnt help much in the end as I can then not utilise it. 

 

I need to see this weighted average market unit rate grouped by day and on the row total, if this then sits on the month and year row total that would be ideal too. Something similar to the following 

 

 

 

Ive tried to follow that post and still get lost - https://community.powerbi.com/t5/Desktop/Weighted-Average-Total-Measure/m-p/525284

Hopefully someone can assist 

 

 

  • Many thanks I was getting stuck on the visual / dax itself which was throwing my maths off. I just had to divide the total order value by qty and ey voila. 

2 Replies

  • danish169 , Create a meausre like

     

    Calculate([#DailyWeightedAvg], allexcept(Table, Table[Date]))

     

    or

     

    Calculate([#DailyWeightedAvg], filter(allselected(Table), Table[Date] = max(Table[Date])) )

  • Many thanks I was getting stuck on the visual / dax itself which was throwing my maths off. I just had to divide the total order value by qty and ey voila.