Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Haric1177
Regular Visitor

How to filter blank rows in Switch condition based on different slicer value

I have 3 measure , Sales , Quantity , Profit they have few blank rows . I have slicer with Sales, Qty,Profit .

When Slicer value =Sales then sales>0 or not null rows when Slicer value=Qty then Qty>0 or not null ..etc

this should result a boolen value (true/false) get it applied to my chart as filter DAX measure Why do my SWITCH measure results have a long number despite selecting 2 decimals? 

2 REPLIES 2
Haric1177
Regular Visitor

Hi Amit , Thanks for quick reply . Slicer values are driven by enter data table values .

I have rows with Blanks and Zero's also .

In this case how can we write using SelectedValue option 

amitchandak
Super User
Super User

@Haric1177 , if you use a field parameter for the slicer, it should not show blank values when this measure has blank > 0 is different

for that use the selected measure code, and then create one measure and use that as visual level filter

 

This how you get that in case of field paremeters

Selected measure = maxx(filter(measure ,measure[measure Order] = SELECTEDVALUE(measure[measure Order])), measure[measure])

 

Switch(True() ,

[Selected measure] = "Sales" ,[Sales] >0, 1,

[Selected measure] = "Qty" ,[Qty] >0, 1,

0)

 

use visual level filter for this measure and it should be 1

 

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors