Forum Discussion
Filter on Subtotals values
- Anonymous4 years ago
Hi moatazbelah ,
Power BI doesn't support us to filter Subtotal in Filter Field directly. As you test, we could only filter actual value by Filter Field. If you want to use Subtotal as a category and filter it, I suggest you to create an unrelated Slicer table, then create a measure and add this measure in visual level filter.
My Sample:
Subtotal Table:
Subtotal = GENERATESERIES(1, SUM('Table'[Total]))Measure:
Filter Subtotal = VAR _Subtotal = CALCULATE ( SUM ( 'Table'[Total] ), ALLEXCEPT ( 'Table', 'Table'[Order Number] ) ) VAR _SELECTVALUE = MAX ( Subtotal[Value] ) RETURN IF ( ISFILTERED ( Subtotal[Value] ), IF ( _Subtotal = _SELECTVALUE, 1, 0 ), 1 )Add this measure into visual level filter in matrix visual and set it to show items when value =1.
Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi moatazbelah ,
Power BI doesn't support us to filter Subtotal in Filter Field directly. As you test, we could only filter actual value by Filter Field. If you want to use Subtotal as a category and filter it, I suggest you to create an unrelated Slicer table, then create a measure and add this measure in visual level filter.
My Sample:
Subtotal Table:
Subtotal = GENERATESERIES(1, SUM('Table'[Total]))
Measure:
Filter Subtotal =
VAR _Subtotal =
CALCULATE (
SUM ( 'Table'[Total] ),
ALLEXCEPT ( 'Table', 'Table'[Order Number] )
)
VAR _SELECTVALUE =
MAX ( Subtotal[Value] )
RETURN
IF ( ISFILTERED ( Subtotal[Value] ), IF ( _Subtotal = _SELECTVALUE, 1, 0 ), 1 )
Add this measure into visual level filter in matrix visual and set it to show items when value =1.
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.