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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
swandernoth
Regular Visitor

Merge consecutive time intervals

Hi everyone,

 

I'm trying to merge some rows of a table based on consecutive time intervals. My table looks something like this:

 

 

Start DateEnd DateValue
01/01/202202/01/202210
02/01/202204/01/202210
04/01/202205/15/202210
05/15/202206/01/202220
06/01/202208/13/202220
08/13/202209/01/202220
09/01/202210/31/202220
10/31/202212/24/202210
12/24/2022  01/10/2023  10
01/10/202303/27/202310

 

I would like to merge the rows within each block of similar values in the "value" column, so that the result looks like:

 

 

Start DateEnd DateValue
01/01/202205/15/202210
05/15/2022  10/31/2022  20
10/31/202203/27/202310

 

A simple 

 

 

 

 

GROUPBY(table, [Value], "Start Date Merged", MINX(CURRENTGROUP(), [Start Date]), "End Date Merged", MAXX(CURRENTGROUP(), [End Date]))

 

 

 

 

 doesn't work because the values in "Value" are not unique outside the blocks I want to merge.

 

Any help with this would be greatly appreciated, as I have been trying to wrap my head around this for quite some time.

 

Thanks!

1 REPLY 1
amitchandak
Super User
Super User

@swandernoth , Refer if this can help , you case the diff is 0

https://community.powerbi.com/t5/Community-Blog/Power-BI-Continuous-Streak-With-One-Day-Break/ba-p/1...

 

Continuous streak: https://youtu.be/GdMcwvdwr0o

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.