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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
sidd_xp
New Member

How to restrict slicer visual to select only 2 values

I created a report with a slicer in it. The Slicer has 16 values like Q1_2018, Q2_2018 etc. What i want help in, is to restrict the slicer to select only 2 values so that user can only see comparison between 2 quarters only out of 16.

1 ACCEPTED SOLUTION

Hi, @sidd_xp 

You can try function CONCATENATEX  to concatenate the values in slicer.

Measure1 = 
IF (
    COUNTROWS ( ALLSELECTED ( DateTable[Year Quarter] ) ) > 2,
    "Select less values",
    CONCATENATEX (
        VALUES ( DateTable[Year Quarter] ),
        DateTable[Year Quarter],
        " vs "
    )
)

19.png

 

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@sidd_xp , you can display a message and make you data blank using visual level filter

 

if (countrows(allselected(Table[Column])) >2, "Select less values", Blank())

 

Check this measure blank in all visuals and display message on a card

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

Thanks, this is a good walkaround, i tried and its working fine. But what if in place of Blank(), i want to show the exact 2 values which are selected in card. How can i do that ?

 

Hi, @sidd_xp 

You can try function CONCATENATEX  to concatenate the values in slicer.

Measure1 = 
IF (
    COUNTROWS ( ALLSELECTED ( DateTable[Year Quarter] ) ) > 2,
    "Select less values",
    CONCATENATEX (
        VALUES ( DateTable[Year Quarter] ),
        DateTable[Year Quarter],
        " vs "
    )
)

19.png

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.