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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
medabee45
Regular Visitor

Filter Table based on output of a Measure

Hello, 


I've created a measure to return a specific text value based on a selected date. I want to use that text valve to filter another table. Can this be done? 

The Measure is:

 

Crewonshift =
VAR _date =
    SELECTEDVALUE ( 'Date'[Date] )
VAR _Crewonshift =
    CALCULATE (
        MAX(OnshoreCrewRoster[Crew ]),
        FILTER (
            ALL (OnshoreCrewRoster),
            _date >= OnshoreCrewRoster[Start Date]
                && _date <= OnshoreCrewRoster[End Date ]
               
        )
    )
RETURN
    IF ( _Crewonshift<> BLANK (), _Crewonshift, "NULL" )
 
 
I want to filter the table below based on the output of the measure, e.g. of the measure "Crewonshift" = "A" then the table should only return values for which the column "Crew" has A in it. 
medabee45_0-1662321367343.png

 

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

Hi @medabee45 ,

According to your description, here's my solution.

Create a measure.

Check =
IF ( MAX ( 'Table (2)'[Crew] ) = [Crewonshift], 1, 0 )

Put the measure in the visual filter and select its value to 1.

vkalyjmsft_0-1662363892289.png

After click apply filter, the visual will be filtered by the value of the Crewonshif.

vkalyjmsft_1-1662364011248.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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
v-yanjiang-msft
Community Support
Community Support

Hi @medabee45 ,

According to your description, here's my solution.

Create a measure.

Check =
IF ( MAX ( 'Table (2)'[Crew] ) = [Crewonshift], 1, 0 )

Put the measure in the visual filter and select its value to 1.

vkalyjmsft_0-1662363892289.png

After click apply filter, the visual will be filtered by the value of the Crewonshif.

vkalyjmsft_1-1662364011248.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

@medabee45 , Create a measure and use that in visual level filter

 

calculate (if ("Crewonshift" = "A", 1, blank()) , filter(Table, Table[Crew]=1) )

 

or

 

calculate (if ("Crewonshift" = "A" && Table[Crew] , 1, blank())  )

 

Countx(Values(Table[Role]), calculate (if ("Crewonshift" = "A" && Table[Crew] , 1, blank())  ) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.