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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Average number of users across different sites

Hello,

 

I'm trying to create a column or measure that will show the average number of users across 3 different websites. Currently, my data looks like this:

 

SiteDateUser Identifier
random.com01/05/2021582
random.com01/05/2021583
random.com01/05/2021584
random.com02/05/2021586
cats.com03/05/2021587
cats.com04/05/2021588
dogs.com05/05/2021589
dogs.com05/05/2021590

 

My current measure is

 

 

Average users = DIVIDE(DISTINCTCOUNT(Table[User Identifier]),CALCULATE(DISTINCTCOUNT(Table[Date]), ALL(Table)))

 

 

This measure actually works but because not all three sites have been rolled out on the same day, if I filter by one of the sites that rolled out later in the year, I get a daily average user number lower than 1, which is technically not possible.  My initial instinct was to create a number of days column using

 

Number of Days = RANKX(Table, Table[Date],,ASC,Dense)

 

This creates a new column with numbers as days. So, for the above example, the first three rows would be 1, followed by 2,3,4 and the last two rows would be 5. But I cannot filter this calculation with different sites as RANKX doesn't allow using filters.

 

Any ideas, how can I overcome this?

 

Thanks,

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a new measure like

averageX(summarize(Table, Table[Site], Table[Date], "_1",DISTINCTCOUNT(Table[User Identifier])),[_1])

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try a new measure like

averageX(summarize(Table, Table[Site], Table[Date], "_1",DISTINCTCOUNT(Table[User Identifier])),[_1])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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