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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ltang6
Frequent Visitor

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!

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @ltang6 

Please refer to the linked tutorials:

PQ:

https://www.youtube.com/watch?v=ISDhR-TzwJk  

Dax

https://www.youtube.com/watch?v=YL7H1Rqckb0&t=128s

Please consider Accepting it as the solution to help the other members find it more quickly

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @ltang6 

Please refer to the linked tutorials:

PQ:

https://www.youtube.com/watch?v=ISDhR-TzwJk  

Dax

https://www.youtube.com/watch?v=YL7H1Rqckb0&t=128s

Please consider Accepting it as the solution to help the other members find it more quickly

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Didn't even know how to frame the problem...

This is exactly what i need. THANK YOU!

Glad to help ☺️

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.