Forum Discussion
koorosh
3 years agoPost Partisan
Switch command including filter
Hi, Please check the attached file (testdays.pbix). I need a command to add to the switch command in the measure 'Dynamicmeasure' so that the slicer can filter the visual table on page one based on t...
- Anonymous3 years ago
Hi koorosh ,
Try this code.
DynamicMeasure = VAR _SELECT = SELECTEDVALUE ( MeasureListTable[MeasureTitle] ) RETURN SWITCH ( _SELECT, "More than 60", CALCULATE ( SUM ( 'Table'[DifferenceDays] ), FILTER ( 'Table', 'Table'[DifferenceDays] > 60 ) ), "More than 100", CALCULATE ( SUM ( 'Table'[DifferenceDays] ), FILTER ( 'Table', 'Table'[DifferenceDays] > 100 ) ), "More than 900", CALCULATE ( SUM ( 'Table'[DifferenceDays] ), FILTER ( 'Table', 'Table'[DifferenceDays] > 900 ) ), CALCULATE(SUM('Table'[DifferenceDays])) )Result:
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hi koorosh ,
Try this code.
DynamicMeasure =
VAR _SELECT =
SELECTEDVALUE ( MeasureListTable[MeasureTitle] )
RETURN
SWITCH (
_SELECT,
"More than 60",
CALCULATE (
SUM ( 'Table'[DifferenceDays] ),
FILTER ( 'Table', 'Table'[DifferenceDays] > 60 )
),
"More than 100",
CALCULATE (
SUM ( 'Table'[DifferenceDays] ),
FILTER ( 'Table', 'Table'[DifferenceDays] > 100 )
),
"More than 900",
CALCULATE (
SUM ( 'Table'[DifferenceDays] ),
FILTER ( 'Table', 'Table'[DifferenceDays] > 900 )
), CALCULATE(SUM('Table'[DifferenceDays]))
)
Result:
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.
koorosh
3 years agoPost Partisan
Could you please check my last question?
https://community.fabric.microsoft.com/t5/Desktop/Joint-table/m-p/3323771#M1109821