Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
Need help on writing Switch condition (or) If and Else If to handle both conditions in a single measure. I tried as below but there is an issue. Attached the screenshot.
SlicerCheck =
IF( ISFILTERED(VehicleTrend[Report Date]),BLANK(),"Please select Report Date")
OR
IF( DISTINCTCOUNT(VehicleTrend[Report Date]) = 1 ,"","Please select Report Date")
Solved! Go to Solution.
hi,@v_krishna
you can try to use this measure:
new SlicerCheck = var a1=CALCULATE(DISTINCTCOUNT(VehicleTrend[ReportDate]),ALLEXCEPT(VehicleTrend,VehicleTrend[ReportDate])) return IF(ISFILTERED(VehicleTrend[ReportDate])=BLANK() || a1> 1 ,"Please Select a Report Date", BLANK())
Then set visual level filter is blank
Result:
Best Regards,
Lin
Thank you for the solution Lin. It works as expected.
hi,@v_krishna
you can try to use this measure:
new SlicerCheck = var a1=CALCULATE(DISTINCTCOUNT(VehicleTrend[ReportDate]),ALLEXCEPT(VehicleTrend,VehicleTrend[ReportDate])) return IF(ISFILTERED(VehicleTrend[ReportDate])=BLANK() || a1> 1 ,"Please Select a Report Date", BLANK())
Then set visual level filter is blank
Result:
Best Regards,
Lin
Thank you for the solution Lin. It works as expected.
hi,@v_krishna
You may try to use || in your formula:
SlicerCheck = IF(ISFILTERED(VehicleTrend[Report Date])|| DISTINCTCOUNT(VehicleTrend[Report Date]) = 1 ,BLANK(),"Please select Report Date")
Best Regards,
Lin
Hi,
Intially i have implemented a measure based on the requirement.
SlicerCheck = IF( ISFILTERED(VehicleTrend[Report Date]),BLANK(),"Please select Report Date")
please refer the below link for details .
I had to update the above measure (refer the update measure below) to accomodate other conditions but facing the issue. Out of 3 conditions, 1st and 2nd conditions are working and 3rd condition is failing.
SlicerCheck =IF(ISFILTERED(VehicleTrend[Report Date])=BLANK() || DISTINCTCOUNT(VehicleTrend[Report Date])> 1 ,"Please Select a Report Date", BLANK())
1) When user select only one of the Report Date from the slicer, the Line chart data is displayed. Below is the working behavior mockup.
2) When none of the Report Date is selected from the slicer, the Line chart is set blank with a message displayed.
Below is the working behavior mockup.
3) Issue is here: If User tries to select more than one Report Date fron the slicer, the expected behaviour is the Line chart should be set to blank with a message displayed BUT there is issue. below is the mockup for reference.
i feel this might be causing the issue but not sure. In the Line chart visuvalization - SlicerCheck measure is applied to Visual filters and it is set to blank. Refer the mockup below.
But now the measure has other condition added "DISTINCTCOUNT(VehicleTrend[Report Date])> 1" . so is this causing the issue for 3rd condition please assist on this