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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Ju743878
Regular Visitor

Expand table rows by dates range from next row with group

Hi everyone, hope your are good !

 

I struggle with some manipulation :

In this i.e i want to transform dynamically this table : 

IDDT_DATETP_EVENT
101/01/2023OPEN
114/01/2023CLOSE
115/01/2023RE-OPEN
115/01/2023EXCEPTION
118/01/2023CLOSE
120/01/2023RE-OPEN
205/01/2023OPEN
210/01/2023EXCEPTION
217/01/2023CLOSE
317/01/2023OPEN
325/03/2023CLOSE

 

To this :

 

IDDT_DATETP_EVENT
101/01/2023OPEN
102/01/2023OPEN
103/01/2023OPEN
104/01/2023OPEN
105/01/2023OPEN
106/01/2023OPEN
107/01/2023OPEN
108/01/2023OPEN
109/01/2023OPEN
110/01/2023OPEN
111/01/2023OPEN
112/01/2023OPEN
113/01/2023OPEN
114/01/2023CLOSE
115/01/2023RE-OPEN
115/01/2023EXCEPTION
116/01/2023EXCEPTION
117/01/2023EXCEPTION
118/01/2023CLOSE
119/01/2023CLOSE
120/01/2023RE-OPEN
205/01/2023OPEN
206/01/2023OPEN
207/01/2023OPEN
208/01/2023OPEN
209/01/2023OPEN
210/01/2023EXCEPTION
211/01/2023EXCEPTION
212/01/2023EXCEPTION
213/01/2023EXCEPTION
214/01/2023EXCEPTION
215/01/2023EXCEPTION
216/01/2023EXCEPTION
217/01/2023CLOSE
317/01/2023OPEN
318/01/2023OPEN
319/01/2023OPEN
320/01/2023OPEN
321/01/2023OPEN
322/01/2023OPEN
323/01/2023OPEN
324/01/2023OPEN
325/03/2023CLOSE

 

In DAX; power query or even SQL as you prefer, someone can help me ?

 

Thanks in advance !

 

BR 

 

Julien

2 REPLIES 2
amitchandak
Super User
Super User

@Ju743878 , Create a date table and join date of date with Dt_date

 

new table

 

Date = calendarauto()

 

then have measures like

 

calculate(lastnonblankvalue(Table[DT_DATE], max(tbale[TP_EVENT])), filter(all('Date'), 'Date'[Date]<= max('date'[Date])))

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi, 

 

Thanks for your suggestion but unfortunatelly it's not the solution i aking for.

 

I want to expand the table row from date to next date row by ID, dynamicly...

 

BR

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.