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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Using SWITCH to filter table and show all if no filter is applied

Hello, 

I am trying to write a measure to use as a filter on a table/matrix visual. The purpose of the filter is to filter the visual, if i have selected a value in another visual. But if i have nothing selected i want to show all the item_no where the "post_month_year (sale)" is blank. 

This is the measure i have so far: 

 

 

test2 = 
SWITCH (
    TRUE (),
    VALUES ( Vareposter_combined[Post_month_year (purchase)] )
        = MAX ( 'Post_month_year (Purchase)'[Post_month_year (purchase)] )
        && VALUES ( Vareposter_combined[Post_month_Year (sale)] )
            >= MAX ( 'Post_month_year (Sale)'[Post_month_Year (sale)] ), 1,
    ISBLANK ( VALUES ( Vareposter_combined[Post_month_year (sale)] ) ), 1,
    NOT ( ISFILTERED ( Vareposter_combined[Post_month_year (purchase)] ) ), 1,
    0
)

 

 

I use the measure like this: 

skanord_0-1638183055871.png

 

1 REPLY 1
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Not sure what's your data. Based on your description, you can create a measure returns 1 when you select a value in another visual, else if you have nothing selected, then it shows all item_no where the "post_month_year (sale)" is blank. 

If you need more help, could you provide

(1) a sample file, you can replace raw data with bogus data to protect your privacy,

(2) or provide some samp data involved in the measure

(3) give your expected result based on the sample you provide

Thanks.

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.