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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors