Forum Discussion
Measure to average a pivot-table column in a Matrix with errors treated as blanks?
mrothschild I think you want:
VAR OUTPUT =
AVERAGEX(
ADDCOLUMNS (
SUMMARIZE (
ALLSELECTED ('Helivalues Transaction History'[Sale Year]),
'Helivalues Transaction History'[Sale Year],
"SUM", SUM ( 'Helivalues Transaction History'[Year of Build] )
),
"__Value", [______A - workaround until you figure out the FiNAL PIECE - Depreciation Volatility Observed] )
),
[__Value]
)
RETURN
OUTPUT
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
- mrothschild5 years agoContinued Contributor
I've tried both the way you suggested and my way, and the Matrix output is identical under both versions.
VAR OUTPUT_NEW = AVERAGEX( ADDCOLUMNS ( SUMMARIZE ( ALLSELECTED ('Helivalues Transaction History'[Sale Year]), 'Helivalues Transaction History'[Sale Year], "SUM", SUM ( 'Helivalues Transaction History'[Year of Build] ) ), "__Value", [______A - workaround until you figure out the FiNAL PIECE - Depreciation Volatility Observed] ) , [__Value] ) VAR OUTPUT_OLD = AVERAGEX( ADDCOLUMNS ( SUMMARIZE ( ALLSELECTED ('Helivalues Transaction History'[Sale Year]), 'Helivalues Transaction History'[Sale Year], "SUM", SUM ( 'Helivalues Transaction History'[Year of Build] ) ), "Percent", CALCULATE ( SUM ( 'Helivalues Transaction History'[Year of Build] ) ) ), [______A - workaround until you figure out the FiNAL PIECE - Depreciation Volatility Observed] ) RETURN - mrothschild5 years agoContinued Contributor
Some progress here. New PBIX file: https://drive.google.com/file/d/1pG3ua4BOWyIJhhh4dOwG9ac8UPWqUsYo/view?usp=sharing
By changing the first [measure] to the following by adding ALLNOBLANKROW first thing after summarize
VAR DEPRECIATION_VOL_OBSERVED = STDEVX.S( SUMMARIZE ( ALLNOBLANKROW('Helivalues Transaction History'), 'Helivalues Transaction History'[Sale Year] ) , [Average Annualized Price change (weighted by Model Year Units)] )I get **a** sub-total rather than NaN. What that subtotal represents isn't entirely apparent, and isn't dynamic across the pivoted columns. It's summarized as 5.76% for each column and the grand total, rather than the average of what I perceive to be the available data points.
- Anonymous5 years agoNot applicable
Hi mrothschild
Your sample is complex and there may be some sensitive data in your pbix file, please remove the link and share a easy sample with us. You can show us the result you want by screenshot as well. This may make it easier for us to understand your requirements.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.