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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
YASHASHRI
Helper I
Helper I

calculate last year value

I calculated last year's sales value but it is giving me an empty value.

the scenario is: I have a table with region max year sale value (for the current year) and yoy (max year-last year).
for example, if i am selecting 2023 and quarter Q2, then the value is 25 and after that selecting 2022 and quarter Q2, then the value is 51. 
so for the year 2023 yoy value should be 25-51=-26 
but I am getting a value as 25 because last year's value is 0. 


how to calculate LY value in such a way that it will give result on yearly level as well as quarterly level.



6 REPLIES 6
YASHASHRI
Helper I
Helper I

@eliasayyy 
I removed all the filters related to date from the dax query.now it is working. But i have a slicer of YY-QQ so whenever i select anything the same issue occurs but  then insted of that when i use year and quarter slicer seperately it works well. What can be the reason?

did you use the all function ? the all will dirgeard all filters pelase share more details what measure did you use

yes before i was using all(date(year)). Now i removed the all condition 

 

te all(date(year)) wil lremove all filters so maybe use the allexcept(date,date[year]) ths will keep the filetrs on for year but please share more info so i can help you more

ok plese share sample of your data and your results

eliasayyy
Memorable Member
Memorable Member

if you have filters on make sure that in your measure , you let powerbi know that dont look at filters maybe use removefilters 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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