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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DATEADD not giving month from last year

Following Date Add logic should return "Dec-2021" as value but giving no result, i am getting NULL in the field can anyone please help in this regard as my agging reports getting effected due to that.
 
 
DATEADD( Aging_label[today].[Date],-1,MONTH)
 
1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

Hi @Anonymous 

In your formula aj1973_0-1641131856030.png you are using  a date column from the fact table which might contain gaps in date. Time Intelligence functions like DATEADD work more efficiently with a Calendar Date Table. 

You need to add a Calendar date table to your model and link it to the fact table on date column, then use Calendar date column into your DAX formula.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

9 REPLIES 9
v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous ,

Dateadd returns a table that contains a column of dates, shifted either forward or backward in time by the specified number of intervals from the dates in the current context.

Do you want to return one column of data or one table?

I have create a sample data.Please have a try.

11.PNG

Create a measure.

Measure = EDATE(SELECTEDVALUE(Aging_label[today]),-1)

22.PNG

Best Regards

Community Support Team _ Polly

 

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

 

 

aj1973
Community Champion
Community Champion

Hi @Anonymous 

In your formula aj1973_0-1641131856030.png you are using  a date column from the fact table which might contain gaps in date. Time Intelligence functions like DATEADD work more efficiently with a Calendar Date Table. 

You need to add a Calendar date table to your model and link it to the fact table on date column, then use Calendar date column into your DAX formula.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Anonymous
Not applicable

khu786_0-1641121304045.png

JAN is current month and next should be ... one month before current month and next 2 month before current month.. was working fine in 2021 but after change in year creating problem

Is this date column? I mean that functions like DATEADD works only with date formatted field




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Anonymous
Not applicable

yes this is date column

There is something that is not clear, to our side, share the full calculation measure, maybe the date column is not complete or data model. There can be a lot of reasons why not working




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




ALLUREAN
Solution Sage
Solution Sage

Hi, @Anonymous 

 

Try to remove .[Date]

 

Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.

Appreciate your Kudos !!!

https://allure-analytics.com/

https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Anonymous
Not applicable

tried same results

Can you share some examples of your data (sample)?




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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