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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jelibier
Frequent Visitor

How to use Measure to filter a table based on another table

Hi, I would like to filter information using a measure not creating another column.

Basically I have two tables (Table 1 – All Users & Table 2 – Users Last Logon(Last 3 months)) Table 1 has no duplicates and Table 2 has duplicates. the only thing these two tables have in common is the Username column. I created a measure to see how many of these users in the past 3 months were active(

Total Active Users =

DISTINCTCOUNT('Table2 - User Last Logon'[User Name]) - CALCULATE(

    DISTINCTCOUNT('Table2 - User Last Logon'[User Name]),

    ISBLANK('Table1 - All Users'[Username])

)

 ). Once I create a table dashboard with Username column & Total Active Users, I see all the username of the users who were active in the past 3 months. I can’t seem to create the opposite of this view. So that I can see all inactive users so I know which users I can remove.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jelibier , Assume Table 2 and Table 1 joined

 

active = DISTINCTCOUNT('Table2 - User Last Logon'[User Name])

 

Inactive = countx(values('Table 1' [User Name]) , if(isblank([Active]), 'Table 1' [User Name], blank()) )

 

Same logic as

Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@jelibier , Assume Table 2 and Table 1 joined

 

active = DISTINCTCOUNT('Table2 - User Last Logon'[User Name])

 

Inactive = countx(values('Table 1' [User Name]) , if(isblank([Active]), 'Table 1' [User Name], blank()) )

 

Same logic as

Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors