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
Olivier960
New Member

Showing running number of active users (at each given date)

Good day to all,

 

I have a database of Users. Each user has a Start Date and a End Date. When a given date (for instance today) is between those 2 dates, it means the user is Active. The database looks like this:

 

UserIdStartDateEndDate
101/01/202208/01/2022
204/01/202211/01/2022
307/01/202214/01/2022
410/01/202217/01/2022
513/01/202220/01/2022

 


I would like to create a line chart that shows how many users were active at each given date (since the first Start date in the entire database). So on the horizontal axis, I would have all the dates since the first Start date. And as Values, I would have the number of UserId for which the Start Date was earlier than that given date, and the End Date later than that given date.

 

Appreciate a lot all the support I can get, I've been struggling with this for a while.


 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Olivier960,

 

Try this measure. There is no relationship between the two tables, and DimDate[Date] is used as the X axis.

 

Active Users =
CALCULATE (
    COUNTROWS ( Table1 ),
    Table1[StartDate] < MAX ( DimDate[Date] ),
    Table1[EndDate] > MAX ( DimDate[Date] )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@Olivier960,

 

Try this measure. There is no relationship between the two tables, and DimDate[Date] is used as the X axis.

 

Active Users =
CALCULATE (
    COUNTROWS ( Table1 ),
    Table1[StartDate] < MAX ( DimDate[Date] ),
    Table1[EndDate] > MAX ( DimDate[Date] )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you so much, you made my day!

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.