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
gumis_rulez
Helper I
Helper I

DATEADD is not returning Total sales from previous year

I have an issue with dateadd function that not returns total sales from previous year:

 

issue_01.jpg

 

What is wrong?

 

https://drive.google.com/file/d/1Y2eJD4NTWY8eCLfb7SB2FlnFwAgCH4qW/view?usp=sharing 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

The measure is working, but you don't have any filters on the card visual. That means that the entire date table is visible in the evaluation context, so the DATEADD is showing all dates prior to 2024. If you put the PY measure in the column chart it works.

You could add a relative date filter to the card visual to only show the current year.

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

The measure is working, but you don't have any filters on the card visual. That means that the entire date table is visible in the evaluation context, so the DATEADD is showing all dates prior to 2024. If you put the PY measure in the column chart it works.

You could add a relative date filter to the card visual to only show the current year.

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.