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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Dateadd function returns wrong values

Hi,

I created a measures with a dateadd function which should return the sales of the prior year. The formular entered is

UmsatzVJ = CALCULATE(SUM('Extrakt SAA'[Umsatz]);DATEADD(Kalender[Datum];-1;YEAR)).

 

I have a own table for the calendar (Kalender) which is linked to the sales table(Extrakt SAA). Date coloums in both tables are formated as date. The Kalender table has no gap and includes all dates of the sales table.

 

The problem is that the formular above returns the same figures in prior year and current year. There is no message error.

 

For exampel:  Year  sales    sales-last year

                       2012  1,000     1,000

but prior year was 900???

 

Maybe someone has an idea what is going wrong?

 

Thank you in advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you for you support but I found the error.

 

In the visuals I selected the date coloumn from the sales table instead of the Kalender table. This means when I select a year in my visual values are filtered to that single year and the values of the prior year are not in the table. I changed the fields and now it's working perfect.

 

Thank you again for your help.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Thank you for you support but I found the error.

 

In the visuals I selected the date coloumn from the sales table instead of the Kalender table. This means when I select a year in my visual values are filtered to that single year and the values of the prior year are not in the table. I changed the fields and now it's working perfect.

 

Thank you again for your help.

Ashish_Mathur
Super User
Super User

Hi,

 

What result do you get when you try this

 

=CALCULATE(SUM('Extrakt SAA'[Umsatz]);PREVIOUSYEAR(Kalender[Datum]))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi,

 

No error message but blank values only.

Hi,

 

Share the link from where i can download your workbook.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MattAllington
Community Champion
Community Champion

Which table is your "year" in the visual coming from?  Is it from your calendar table?



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Thank you, you were right. I have to change my date fields in the slicer it's coming from the sales table.

 

Thank you again

Anonymous
Not applicable

Hi,

Yes it is from the calender table. I tryed to change the realitonsship, sorted the date column but the result did not change.

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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