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
cwollett
Advocate II
Advocate II

DAX Help - measure to select all matching rows from table given a slicer setting

I need some assistance with a DAX measure. I feel like what I want to do is possible, but I'm not sure how to do it.

 

For simplicity's sake, let's say I have a table that looks like this:

PresentationNameRoomStartEndDate
Science 1AnnE1238:008:506/1/2022
Science 2BettyE1259:009:506/1/2022
Science 3CarolE12710:0010:506/1/2022
Tech 1DeniseW1238:008:506/1/2022
Tech 2EstherW1259:009:506/1/2022
Tech 3FranW12710:0010:506/1/2022
Engineering 1FranW12310:0010:506/1/2022
Engineering 2EstherW1258:008:506/1/2022
Engineering 3DeniseW1279:009:506/1/2022
Math 1CarolE12310:0010:506/1/2022
Math 2BettyE1258:008:506/1/2022
Math 3AnnE1279:009:506/1/2022

 

I want to have a slicer with the room options, and when I select a value in that slicer, it triggers a measure calculation that returns TRUE/1 for any person using that room in the table. For example, if I select room E123, since both Ann and Carol have a presentation in that room, it would mark all rows for Ann and Carol as TRUE.

 

cwollett_0-1654023850287.png

I've tried doing this by manipulating slicer filtering:

  • Filter1 with room list
  • Filter2 with person list
  • Have Filter1 filter Filter2
  • Have Filter2 filter Table

Unfortunately, "Select All" on a slicer also selects any undisplayed items as well. Counter-intuitive in my opinion, but the fact of the matter is it makes using just slicers not work.

 

Anyone have thoughts? Nudges as to the right DAX formulas/expressions that might work?

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @cwollett ,

 

Try this:

 

Room Slicer = VALUES('Table'[Room])
Measure = 
VAR SelectedRoom_ =
    VALUES ( 'Room Slicer'[Room] )
VAR RelatedName_ =
    SUMMARIZE (
        FILTER ( ALL ( 'Table'[Name], 'Table'[Room] ), [Room] IN SelectedRoom_ ),
        [Name]
    )
RETURN
    IF ( MAX ( 'Table'[Name] ) IN RelatedName_, 1 )

 

FILTER.gif

 

For more details, please check the attached .pbix file.

 

Best Regards,

Icey

 

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

3 REPLIES 3
Icey
Community Support
Community Support

Hi @cwollett ,

 

Try this:

 

Room Slicer = VALUES('Table'[Room])
Measure = 
VAR SelectedRoom_ =
    VALUES ( 'Room Slicer'[Room] )
VAR RelatedName_ =
    SUMMARIZE (
        FILTER ( ALL ( 'Table'[Name], 'Table'[Room] ), [Room] IN SelectedRoom_ ),
        [Name]
    )
RETURN
    IF ( MAX ( 'Table'[Name] ) IN RelatedName_, 1 )

 

FILTER.gif

 

For more details, please check the attached .pbix file.

 

Best Regards,

Icey

 

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

amitchandak
Super User
Super User

@cwollett , if the room filter is coming from table or joined table 

new measure=

if( countrows(Table)+0 >0, 1, 0)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Unfortunately that does not work. The filter cannot be tied to the table or it filters out more rows than I'd like. In the image above, I don't have that filter acting on that table.

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.