The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I've look at the other weighted average posts and still a little confused so hoping for some help. I have a large data set with SKUs, a metric called pallet factor (how much of that particular SKU fits on a pallet, ex - 54 cases), and a quantity shipped for the month (ex - 32 cases of this SKU shipped in December).
I need to create a weighted average using the amount of times shipped x the pallet factor, so I'm weighting the pallet factor.
BUT I need to make it able to be filtered. So if I select the clothes department, it changes the weights to only the clothes department. If it's the pet department, only the pet department, and if its both, then both are included in the weights.
Here is my formula so far -
Weighted PF =
Solved! Go to Solution.
@Thigs , try like
Weighted PF =
VAR _Table = summarize('Order Data','Order Data'[SKU], "Quantity New", sum('Order Data'[Quantity]), "PF", AVERAGE('Pallet Factor'[PF]))
RETURN
divide( SUMX(_Table, [Quantity New] * [PF]),SUMX(_Table,[Quantity New]))
or
Weighted PF =
VAR _Table = summarize('Order Data','Order Data'[SKU], "Quantity New", sum('Order Data'[Quantity]), "PF", AVERAGE('Pallet Factor'[PF]))
RETURN
SUMX(_Table, divide([Quantity New] * [PF],[Quantity New]))
@Thigs , try like
Weighted PF =
VAR _Table = summarize('Order Data','Order Data'[SKU], "Quantity New", sum('Order Data'[Quantity]), "PF", AVERAGE('Pallet Factor'[PF]))
RETURN
divide( SUMX(_Table, [Quantity New] * [PF]),SUMX(_Table,[Quantity New]))
or
Weighted PF =
VAR _Table = summarize('Order Data','Order Data'[SKU], "Quantity New", sum('Order Data'[Quantity]), "PF", AVERAGE('Pallet Factor'[PF]))
RETURN
SUMX(_Table, divide([Quantity New] * [PF],[Quantity New]))
Worked beautifully, thanks a bunch!
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |