Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello - I am needing help with a weighted average calculate across multiple combination of categories. This is a first attempt, utilizing PBI quickmeasures - unfortunately only allows one category
Moisture WtAvg per Field =
VAR __CATEGORY_VALUES = VALUES('Table'[Field])
RETURN
DIVIDE(
SUMX(
KEEPFILTERS(__CATEGORY_VALUES),
CALCULATE([SumMoisture] * [WetBushels])
),
SUMX(KEEPFILTERS(__CATEGORY_VALUES), CALCULATE([WetBushels]))
)
I am really needing a single? measure that can handle most any combination of categories.
The three most needed are identified in the attached file - as visuals.
The blue circled should be 14.0% and Red 20.87%
Hopefully this google link with example file will work for you!
https://drive.google.com/open?id=1H4-ELiGSIK-v3el6zlBNABFugJfModo0 |
As Always - thank you!
Solved! Go to Solution.
You need to iterate at the lowest level of granularity for it to work properly at all levels.
In this case, you can iterate at the table row level to keep things simple.
Avg Moisture =
DIVIDE (
SUMX ( 'Table', [SumMoisture] * [WetBushels] ),
SUMX ( 'Table', [WetBushels] )
)
Note that this gives 14% for both numbers circled. The value 20.87% makes no sense when all of the moisture measurements are below 16%.
Hi,
How did you calculate the 20.87%?
Sorry, I was working off a spreadsheet, and had a transposed number. Appreciate your time - solution has been found.
You need to iterate at the lowest level of granularity for it to work properly at all levels.
In this case, you can iterate at the table row level to keep things simple.
Avg Moisture =
DIVIDE (
SUMX ( 'Table', [SumMoisture] * [WetBushels] ),
SUMX ( 'Table', [WetBushels] )
)
Note that this gives 14% for both numbers circled. The value 20.87% makes no sense when all of the moisture measurements are below 16%.
Thank you very much. After all my google searches, your solution is so elegant. Apologize on the 20% number, I was working off a spreadsheet, and had a wrong number typed in.
Thank you!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |