Forum Discussion
Remove Row Context from a hierarchy column in Matrix visualization
- Anonymous3 years ago
Hi Anonymous ,
Since you want to keep the selections of filtering, such as slicers. You can change your formula as
Share = VAR Numerator = SUM ( 'TABLENAME'[SALES_VALUE] ) VAR Denominator = CALCULATE ( SUM ( 'TABLENAME'[SALES_VALUE] ), FILTER ( ALLSELECTED ( TABLENAME ), TABLENAME['FILTER COL 1'] = MAX ( TABLENAME['FILTER COL 1'] ) && TABLENAME['FILTER COL 2'] = MAX ( TABLENAME['FILTER COL 2'] ) ) ) RETURN DIVIDE ( Numerator, Denominator, 0 )ALLSELECTED function (DAX) - DAX | Microsoft Learn
The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Since you want to keep the selections of filtering, such as slicers. You can change your formula as
Share =
VAR Numerator =
SUM ( 'TABLENAME'[SALES_VALUE] )
VAR Denominator =
CALCULATE (
SUM ( 'TABLENAME'[SALES_VALUE] ),
FILTER (
ALLSELECTED ( TABLENAME ),
TABLENAME['FILTER COL 1'] = MAX ( TABLENAME['FILTER COL 1'] )
&& TABLENAME['FILTER COL 2'] = MAX ( TABLENAME['FILTER COL 2'] )
)
)
RETURN
DIVIDE ( Numerator, Denominator, 0 )
ALLSELECTED function (DAX) - DAX | Microsoft Learn
The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.