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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
jdog05
Frequent Visitor

Filter table on a combination of multiple column selections

Hi, we have a scenario were users need to filter a table based on a combination of columns B & C selections with column C being a range of values. Haven't found a solution that works so hoping someone in the communtity can help.

 

jdog05_1-1725258866403.png

Hope this example is clear, thanks! 

 

1 ACCEPTED SOLUTION
v-linhuizh-msft
Community Support
Community Support

Thanks for the reply from Idrissshatila.

 

Hi @jdog05 ,  

Using the sample data you gave me, I achieved your desired effect by creating two new tables for columns B and C respectively that have no relation to the original table, here are my steps:

 

1.Use the VALUES function to create new tables for columns B and C to use as slicer fields.

B1 = VALUES('Table'[B])

B2 = VALUES('Table'[B])

C1 = VALUES('Table'[C])

C2 = VALUES('Table'[C]) 

 

2.Create four slicers:

 vlinhuizhmsft_4-1725362044780.png

 

3.Create a meausre and filter the table:

Measure =
IF(
    (
        (SELECTEDVALUE('Table'[B]) = SELECTEDVALUE('B1'[B]) &&
        SELECTEDVALUE('Table'[C]) >= MIN('C1'[C]) &&
        SELECTEDVALUE('Table'[C]) <= MAX('C1'[C]))
        ||
        (SELECTEDVALUE('Table'[B]) = SELECTEDVALUE('B2'[B]) &&
        SELECTEDVALUE('Table'[C]) >= MIN('C2'[C]) &&
        SELECTEDVALUE('Table'[C]) <= MAX('C2'[C]))
    ),
    1,
    0
)
vlinhuizhmsft_2-1725361733576.png
4.The final result is as follows:
 vlinhuizhmsft_5-1725362199471.png

 

Best Regards,
Zhu

 

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!

 

View solution in original post

3 REPLIES 3
v-linhuizh-msft
Community Support
Community Support

Thanks for the reply from Idrissshatila.

 

Hi @jdog05 ,  

Using the sample data you gave me, I achieved your desired effect by creating two new tables for columns B and C respectively that have no relation to the original table, here are my steps:

 

1.Use the VALUES function to create new tables for columns B and C to use as slicer fields.

B1 = VALUES('Table'[B])

B2 = VALUES('Table'[B])

C1 = VALUES('Table'[C])

C2 = VALUES('Table'[C]) 

 

2.Create four slicers:

 vlinhuizhmsft_4-1725362044780.png

 

3.Create a meausre and filter the table:

Measure =
IF(
    (
        (SELECTEDVALUE('Table'[B]) = SELECTEDVALUE('B1'[B]) &&
        SELECTEDVALUE('Table'[C]) >= MIN('C1'[C]) &&
        SELECTEDVALUE('Table'[C]) <= MAX('C1'[C]))
        ||
        (SELECTEDVALUE('Table'[B]) = SELECTEDVALUE('B2'[B]) &&
        SELECTEDVALUE('Table'[C]) >= MIN('C2'[C]) &&
        SELECTEDVALUE('Table'[C]) <= MAX('C2'[C]))
    ),
    1,
    0
)
vlinhuizhmsft_2-1725361733576.png
4.The final result is as follows:
 vlinhuizhmsft_5-1725362199471.png

 

Best Regards,
Zhu

 

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!

 

thanks @v-linhuizh-msft this works perfectly, really appreciate your help 😉

Idrissshatila
Super User
Super User

Hello @jdog05 ,

 

then you can add two slicers, first one is a drop down slicer that shows the data of column B and the second is a between slicers.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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