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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Dark_Bi
Regular Visitor

Filter Users that does not match both status

Hi, I am trying to filter users that are as "Status" only Concluded, but are not Active.

 

Dark_Bi_7-1658322288764.png

 

For example :

Paolo Pio was in a class Concluded but is also in a class Active so I should exclude it.

Carlo Tol Concluded two classes but is also Active in one class so I should exclude it.

Mich Rovati was in a class concluded so it is ok for the result table

Gianni Cosati is in a class Active so it should be excluded

 

Correct Results

Dark_Bi_5-1658321583429.png

 

Do you know how to do it in Power Bi?

Thank you very much.

 

1 ACCEPTED SOLUTION

Hi @Dark_Bi 

 

Use this measure to filter your visuals:

Measure = 
Var _Status = filter(addcolumns(all('Table 1'),"ST",RELATED('Table 2'[Status])),[ST]="Active")
Var _A = SUMMARIZE(_Status,[Last name])
return
if(MAX('Table 1'[Last name]) in _A,1,0)

 

Output:

VahidDM_0-1658399635813.png

 

 

Download the attached file.

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

View solution in original post

5 REPLIES 5
Dark_Bi
Regular Visitor

Is it ok?

 

Table 1      
User idNameLast nameClass ID   
1PaoloPio2   
1PaoloPio6   
2MarioMeol7   
3CarloTol5   
3CarloTol7   
3CarloTol8   
4MichRovati6   
5GianniCosati9   

 

Table 2 
Class IDStatus

2

Active
3Concluded
4Concluded
5Active
6Concluded
7Concluded
8Concluded
9Active
VahidDM
Super User
Super User

Hi @Dark_Bi 

 

Can you send your data in TEXT format to be able to copy and paste them 

 

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Is it ok?

 

Table 1      
User idNameLast nameClass ID   
1PaoloPio2   
1PaoloPio6   
2MarioMeol7   
3CarloTol5   
3CarloTol7   
3CarloTol8   
4MichRovati6   
5GianniCosati9   

 

Table 2 
Class IDStatus

2

Active
3Concluded
4Concluded
5Active
6Concluded
7Concluded
8Concluded
9Active

Hi @Dark_Bi 

 

Use this measure to filter your visuals:

Measure = 
Var _Status = filter(addcolumns(all('Table 1'),"ST",RELATED('Table 2'[Status])),[ST]="Active")
Var _A = SUMMARIZE(_Status,[Last name])
return
if(MAX('Table 1'[Last name]) in _A,1,0)

 

Output:

VahidDM_0-1658399635813.png

 

 

Download the attached file.

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Great Solution!! Thank you very much!

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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.