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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.