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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Jan1984
New Member

Rolling DateTime Calulation

Hello All,

 

I am Receiving a daily rolling 10 Days Extract every day, where I need to modify the provided Date Column.

Therefore I created an example Dataset with only the Date Column(File -->https://we.tl/t-8qG67CEYcQ) for testing purposes.

Below you find the criteria’s I would need…

 

Dates within the Extract…

  • Todays Extract would be - From MinDateTime(02 Mar 2022 00:45) to MaxDateTime(11 Mar 2022 08:20)
  • Tomorrows Extract would be - From MinDate(03 Mar 2022 XX:XX) to MaxDate(12 Mar 2022 XX:XX)

 

Required date changes in an Extra Calculated Column should be…

  1. Dates > MaxDate 11 Mar 07:00 == Blank or NA

 

  1. 11/02 07:00 – 10/02 06:59:59  == 11/02
  2. 10/02 07:00 – 09/02 06:59:59  == 10/02
  3. 09/02 07:00 – 08/02 06:59:59  == 09/02
  4. 08/02 07:00 – 07/02 06:59:59  == 08/02
  5. 07/02 07:00 – 06/02 06:59:59  == 07/02
  6. 06/02 07:00 – 05/02 06:59:59  == 06/02
  7. 05/02 07:00 – 04/02 06:59:59  == 05/02
  8. 04/02 07:00 – 03/02 06:59:59  == 04/02
  9. 03/02 07:00 – 02/02 06:59:59  == 03/02

 

  1. Dates < MinDate  02 Mar 07:00 == Blank or NA

 

 

Thanks in advance for your Support

Have a nice Day

Best Regards

Jan

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Jan1984 Maybe:

let
    Source = fnDateTable(#date(2020,1,1), #date(2022,12,31)),
    #"Filtered Rows" = Table.SelectRows(Source, each Date.IsInPreviousNDays([Date], 10))
in
    #"Filtered Rows"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hello,

Thanks a lot for you reply, unfortuanatly the provided idea is not exactly what i am looking for because my rolling every day rawdata will show the prev. 10 days anyway so your filtering solution would be obsolete.

 

I rather try to create an additional Date column where i am grouping the existing Dates based on the above provided criterias.

 

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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