cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors