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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
hescudero95
New Member

Issues handling Year Over Year in non continious dates

Hi everybody, I really need your help. So I have a table with non continious dates (they are working days dates), and I need to calculate the YoY variation. The issue I have is that using dateadd returns blanks values instead of the closest avaiable date. For example if my current date is october 02, 2023 I want it to return the variation considering as last year date september 30, 2022 (since october 2 and october 1 are weekends). Please I need your help. 

2 REPLIES 2
v-nuoc-msft
Community Support
Community Support

Hi @hescudero95

 

@lbendlinThank you very much for sharing

 

I understand that you encountered an error when using dateadd.

 

You mentioned that you have a table containing non-consecutive dates.

 

 For the dateadd function, it returns a table containing a column of dates that are shifted forward or backward in time by a specified number of intervals from the date in the current context.

 

Note that if the dates in the current context do not form consecutive intervals, this function will return an error.

 

You can view the link below for more details:

 

DATEADD function (DAX) - DAX | Microsoft Learn

 

If you still have problems, it is best to provide the pbix file and be careful to delete sensitive data.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

lbendlin
Super User
Super User

Add a contiguous and covering Calendar table to your data model. Run the time intelligence functions against that table.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.