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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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
Anonymous
Not applicable

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.