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
Anonymous
Not applicable

Weighted average Measure

Hi guys,

 

i need to create a weighted average measure for the following scenario:

 

I have 3 SKU on stock with a stock reach of 10 days each (Col: Stock reach per Qty). 

 

They all have 5 quantities on stock (Col: Average Qty on stock).

 

But they have different volume (Col: Volume per stock unit). 

 

Now i want to weight the total stock reach of the quantities with the volume. To illustrate i created the two Helping Columns where i calculate what i need for the weighted average. The result is the Col: Total Days Stock reach weighted. This column i want to create with a measure. But without the helping columns since i dont want to create them in the Power BI Model. Here the example:

 

     Helping Columns  
SKUStock reach per QtyAverage Qty on StockVolume per Stock Unit Total Days Stock reachTotal Volume for stock reachTotal Days Stock reach weightedCalculation
1231051 50500,45=50*50/5550
123410510 505004,50=50*500/5550
12345105100 50500045,05=50*5000/5550
TOTAL     5550  

 

How must i create the measure for this column?

 

Thanks guys!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,Try like

 

divide(sumx(all(Table),Table[Stock Unit]*Table[Stock reach]*Table[Stock reach]) ,sumx(all(Table),Table[Stock Unit]*Table[Stock reach]))

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

So 'Total Days Stock reach' and 'Total volumn for stock reach' are two calculate columns, right? Could you also share the dax expression of the two calculate columns?

 

Community Support Team _ Jimmy Tao

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

amitchandak
Super User
Super User

@Anonymous ,Try like

 

divide(sumx(all(Table),Table[Stock Unit]*Table[Stock reach]*Table[Stock reach]) ,sumx(all(Table),Table[Stock Unit]*Table[Stock reach]))

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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.