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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors