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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks @amitchandak!

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.