Forum Discussion
Anonymous
6 years agoNot applicable
One Measure With Different Calculations Depending on Matrix Row Group Value
Hi everyone, I need to add three extra categories or groups at the bottom of a matrix and do a different calculation for them. For example, let's say I have a matrix with one category/group "Car...
- 6 years ago
Hi Anonymous
I am a bit confused by your naming of your table, so I created this sample report with some moclup data: pbix
I have written the measure likemeasure = VAR _sv = CALCULATE ( SELECTEDVALUE ( MatrixRows[MatrixRows] ) ) RETURN SWITCH ( TRUE (); _sv = "Total"; CALCULATE ( COUNTROWS ( cars ); ALL ( Cars ) ); _sv = "Average"; CALCULATE(AVERAGEX ( VALUES ( Cars[CarName] ); CALCULATE(COUNTROWS ( Cars ) ));ALL(Cars)); _sv = "Other"; BLANK (); COUNTROWS ( Cars ) )Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
sturlaws
6 years agoResident Rockstar
Hi Anonymous
I am a bit confused by your naming of your table, so I created this sample report with some moclup data: pbix
I have written the measure like
measure =
VAR _sv =
CALCULATE ( SELECTEDVALUE ( MatrixRows[MatrixRows] ) )
RETURN
SWITCH (
TRUE ();
_sv = "Total"; CALCULATE ( COUNTROWS ( cars ); ALL ( Cars ) );
_sv = "Average"; CALCULATE(AVERAGEX ( VALUES ( Cars[CarName] ); CALCULATE(COUNTROWS ( Cars ) ));ALL(Cars));
_sv = "Other"; BLANK ();
COUNTROWS ( Cars )
)
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
Anonymous
6 years agoNot applicable