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.
Using the following example table
Units | Unit Price |
1 | 100 |
2 | 300 |
1 | 100 |
3 | 300 |
1 | 100 |
While getting the weighted mean of unit price is fairly trivial
SUMX( Table, [Units] * [Unit Price] ) / SUM( Table[Units)
= 1800 / 8
= 225
I am trying to figure out the weighted mode which should equal 300, and am at a loss. Please help 🙂
Solved! Go to Solution.
Here's the long way of doing this:
Here's the long way of doing this:
@lbendlin, thanks for that. Your third example does not actually do a weighted average, as summarized is unordered. But the second one is cleaner than what I had actually ended up using:
Mode = MINX(
TOPN(
1,
ADDCOLUMNS(
VALUES( Table[Unit Price] ),
"Frequency",
CALCULATE( SUM( Table[Units] ) )
),
[Frequency],
0
),
Table[Unit Price]
)
That's actually a really good observation - I will need to investigate if SUMMARIZE() does any sorting or not. I thought it does 🙂
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |