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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Christoffer_B
Frequent Visitor

Distinct count per day from 2 tables summarized by period

Hi, 

 

I'm new to Power BI and are looking to create a report to track product engagement over time.

For that I would need to track active users per day, week & month and compare those with the previous period. I'm having issues creating a formula that can display the distinct count of users PER DAY from the 2 tables.

 

I'm tracking active users from 2 tables (Feature Click & Page View), 1 user can appear in both tables on the same day, in that case the specific user should only appear as 1 count. 

 

I've tried using the formula below, but it doesn't seem to "reset" for each day and thereby doesn't allow comparisons to previous periods.

Distinct Count Page & Feature =
 COUNTROWS(
     DISTINCT(
         UNION(
             VALUES(Fact_Platform_Feature_Click[Platform_User_SK]),
             VALUES(Fact_Platform_Page_View[Platform_User_SK])
         )   
     )  
 )
 
Example data
Table 1:
Table 1Table 1
Table 2:
Table 2Table 2
Result I'm seeking:
Result i'm seekingResult i'm seeking
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Christoffer_B , Create a common Date and user tables and join both tables with these two tables.

 

Now create this measure and plot it with a common date column

 

measure = Countrows(Distinct(union(Distinct(Table1[User]), Distinct(Table2[User])) ) )

 

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solutio...

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Christoffer_B , Create a common Date and user tables and join both tables with these two tables.

 

Now create this measure and plot it with a common date column

 

measure = Countrows(Distinct(union(Distinct(Table1[User]), Distinct(Table2[User])) ) )

 

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solutio...

Thanks @amitchandak!

This appears to be working exactly how i wanted it to! 🙂 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors