Forum Discussion

ltang6's avatar
ltang6
Frequent Visitor
3 years ago
Solved

How to aggregate group by with time interval

Hello all,

 

I want to do some group by aggregation on my dataset. Not sure whether this should be solved with power query or DAX.

 

My dataset has 3 columns. The start date and end date represents the subscription period of the user, in the format mm/dd/yyyy. The first row stands for, user A is active from Jan 1, 2023 to Feb 1, 2023. User could be revoked from time to time. For example user A is revoked at Apr 15, 2023, and reactivated at Jul 1, 2023.

UserStart dateEnd date
A01/01/202302/01/2023
A

02/01/2023

03/01/2023
A03/01/202304/01/2023
A04/01/202304/15/2023
A07/01/202308/01/2023
A08/01/202309/01/2023
B01/01/202302/01/2023
B02/01/202303/01/2023
B03/01/202303/15/2023

 

What i need is to check for every individual day, how many users are active.

The output should be like this. I should plot this table with date as x-axis, and unique user count as y-axis.

DateUser
01/01/2023A
01/02/2023A
...A
04/15/2023A
07/01/2023A
...A
09/01/2023A
01/01/2023B
...B
03/15/2023

B

 

Your help is very much appreciated, thank you very much!

3 Replies