Forum Discussion
Anonymous
1 year agoNot applicable
Need DAX for filter matrix data for second level group by total based on search number input box val
Hi All, I am working on the power bi report where requirement is, there is slicer called "Select View" contains values like "Total" & "Sub Total" and another numeric parameter slicer to get the ...
v-sdhruv
Community Support
1 year agoHi Anonymous ,
You can try this DAX-
Show Row Flag =
VAR SelectedView = SELECTEDVALUE('Select View'[View]) -- "Total" or "Sub Total"
VAR Threshold = SELECTEDVALUE('ThresholdValue'[Value]) -- User input
VAR GroupLevelTotal =
SWITCH(
SelectedView,
"Sub Total", CALCULATE(SUM('Sales'[Amount]), ALLEXCEPT('Sales', 'Sales'[Location])),
"Total", CALCULATE(SUM('Sales'[Amount]), ALL('Sales')),
BLANK()
)
RETURN
IF(GroupLevelTotal > Threshold, 1, 0)
This measure calculates the subtotal per Location or overall total, depending on the selected view.
Then apply visual level filter and set it to 1.
This will keep the detailed rows, but only for groups where the group subtotal or total exceeds the threshold.
Hope this helps!