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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
fregie
New Member

2 fields using 1 filter

Hello Community,

 

I need your help with this problem below.

I have 2 checkbox fields (Field A & Field B).

What I need is to create a filter (with values Yes & No).

Behavior:

1) When Yes is selected then Field A & Field B should be selected as true (checked)

2) When NO  is selected then Field A & Field B should be selected as false (unchecked)

 

Is this possible? What would be the best appoach to handle this? Thanks

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@danextian , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:

 

Hi  @fregie ,

I created some data:

vyangliumsft_0-1719307267201.png

 

Here are the steps you can follow:

1. Enter data – create slicer table.

vyangliumsft_1-1719307267204.png

2. Create measure.

Flag =
var _select=SELECTEDVALUE('Slicer_Table'[Value])
return
SWITCH(
    TRUE(),
    _select="Yes" && MAX('Table'[Group]) in {"Filed A","Filed B"},1,
    _select="No" && NOT(MAX('Table'[Group])) in {"Filed A","Filed B"},1,0)

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_2-1719307286534.png

4. Result:

vyangliumsft_3-1719307286536.png

If my explanations don't meet your expected results or don't understand your question, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

 

Best Regards,

Liu Yang

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@danextian , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:

 

Hi  @fregie ,

I created some data:

vyangliumsft_0-1719307267201.png

 

Here are the steps you can follow:

1. Enter data – create slicer table.

vyangliumsft_1-1719307267204.png

2. Create measure.

Flag =
var _select=SELECTEDVALUE('Slicer_Table'[Value])
return
SWITCH(
    TRUE(),
    _select="Yes" && MAX('Table'[Group]) in {"Filed A","Filed B"},1,
    _select="No" && NOT(MAX('Table'[Group])) in {"Filed A","Filed B"},1,0)

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_2-1719307286534.png

4. Result:

vyangliumsft_3-1719307286536.png

If my explanations don't meet your expected results or don't understand your question, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

 

Best Regards,

Liu Yang

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

danextian
Super User
Super User

Hi @fregie ,

 

I have a very vague idea of what you're trying to achieve. As always, please post a workable sample data (not a screenshot) that represents your actual data and the expected result from that. You can post a link to an Excel file stored in the cloud.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.