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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.