cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors