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
Sabre77
Microsoft Employee
Microsoft Employee

Filter content based on two columns

I've got a directconnection to a source in Power BI and I want to filter upon two things. 

 

so in one table I have Accounts and in the other table I have Tag Name & Tag status

 

Sabre77_0-1706789027768.png

In a second matrix on the same page, I want to filter out all accounts which have Tag Name "Tag 1" and Tag Status "Active"  
How can I achieve that? as I'm trying to do this but I'm failing to do so. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Sabre77 ,

 

Here are the steps you can follow:

1. Create measure.

Flag =
var _select=
SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[Account Key]=MAX('Table'[Account Key])),"Tag",[Tag Name])
return
IF(
    "Tag1" in _select,MAX('Table'[Tag Status]),BLANK())

2. Result:

 

vyangliumsft_0-1708671883301.png

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi  @Sabre77 ,

 

Here are the steps you can follow:

1. Create measure.

Flag =
var _select=
SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[Account Key]=MAX('Table'[Account Key])),"Tag",[Tag Name])
return
IF(
    "Tag1" in _select,MAX('Table'[Tag Status]),BLANK())

2. Result:

 

vyangliumsft_0-1708671883301.png

 

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

Anonymous
Not applicable

Hi  @Sabre77 ,

 

I created some data:

Table1:

vyangliumsft_0-1706841517897.png

Table2:

vyangliumsft_1-1706841517897.png

Here are the steps you can follow:

1. Create measure.

Measure =
IF(
    MAX('Table1'[Tag Name])="Tag1"&&MAX('Table1'[Tag Status])="Active",BLANK(),MAX('Table1'[Tag Status]))

vyangliumsft_2-1706841542618.png

2. Select [Account – turn off “Show” items with no data.

vyangliumsft_3-1706841542620.png

3. Result:

Note: This fits a row of data all blank(), if one of them contains data, the entire row will not be filtered.

vyangliumsft_4-1706841577908.png

If it doesn't meet your desired outcome, 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

lbendlin
Super User
Super User

Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?

Sabre77
Microsoft Employee
Microsoft Employee

Hi, 

Sorry for my late reply but the data is a little bit different .. 🙂 

Sabre77_0-1708327951373.png

Basically it is a table where Tag name only exists for certain actions when they are active and do not exist when not active. 😉 

So I want to filter out all accountkey where Tag1 doesn't exist  

Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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