Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
7 |