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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Need a Slicer to select only two column , should not allow the user to check more than 2 checks

Hi Team,

I have a slicer visualization with dropdown , which user should select only 2 columns(checkbox) , if the user tries to check on 3rd columns it should show a  popup a warning message that "Please select only two columns" how can achieve this

I tried with below query but i cant able to achieve popup as well as  differences between two columns 

Differences = 
VAR SelectedTests =
ALLSELECTED ( 'practice'[Description] )
VAR MinValue =
MINX ( SelectedTests, CALCULATE ( AVERAGE ( 'practice'[Time] ) ) )
VAR MaxValue =
MAXX ( SelectedTests, CALCULATE ( AVERAGE('practice'[Time] ) ) )
VAR Difference = MaxValue - MinValue
VAR NumProductsSelected =
COUNTROWS ( SelectedTests )
VAR Result =
IF (
NumProductsSelected = 2,
Difference,
ERROR ( "Please select only 2 Tests." )
)
RETURN
Result

could somebody please help me to achieve this

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You need to drag the measure into the visual you want to slice and set the filter rules.

vcgaomsft_0-1654570181958.png

vcgaomsft_1-1654570208650.png

Attached PBIX file for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , there is no way to stop, You can create a measure and display message .

 

You can make  visuals blank if more then 2 values are there

 

if(countrows(allselected(Table[Product]) ) >=2, 1,0)

 

not you can use above measure to display message and remove data from visual , above should = 0 (visual level filter)

Anonymous
Not applicable

Hi Amit,

 

Thanks for your reply 
May i know where exactly this soultion can be implemented in my query 

Hi @Anonymous ,

 

You need to drag the measure into the visual you want to slice and set the filter rules.

vcgaomsft_0-1654570181958.png

vcgaomsft_1-1654570208650.png

Attached PBIX file for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Anonymous
Not applicable

thanks for your support its working

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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