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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gvg
Post Prodigy
Post Prodigy

Using measure as a filter in table visual

Hi,

I am looking to figure out how to filter a text-only table with a measure. I have a table like this:

 

Employee            Division
-----------         ----------
Mike                Legal
John                IT
Peter               Legal
George              Sales

 

I want to show only Employees in "Legal" division if my measure evaluates to "Legal", The result should look like this:

Employee            Division
-----------         ----------
Mike                Legal
Peter               Legal

 

I need to do it with a measure since I want to calculate the filter value dynamically. Is there a way to do it?

Thanks.

 

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @gvg,

 

Try measure as:

Measure = 
IF(
    MAX('Table'[Division])="Legal",
    1,
    0)

Here is the output:

v-xulin-mstf_0-1614155049609.png

Here is the demo, please try it.

 

Best Regards,

Link

 

View solution in original post

3 REPLIES 3
v-xulin-mstf
Community Support
Community Support

Hi @gvg,

 

Try measure as:

Measure = 
IF(
    MAX('Table'[Division])="Legal",
    1,
    0)

Here is the output:

v-xulin-mstf_0-1614155049609.png

Here is the demo, please try it.

 

Best Regards,

Link

 

amitchandak
Super User
Super User

@gvg , Try a measure like this

calculate(countrows(Table), filter(Table, Table[Division] ="Legal"))

 

But you can use a slicer for this, no need for a measure

@amitchandak ,thanks.

However I need to figure out how to make the whole thing work through a dynamic measure. I can not have dynamic slicer, can I? The measure in your example will only calculate the number of occurences, but not render the result I want, I am afraid.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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