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

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

Reply
dokat
Post Prodigy
Post Prodigy

Slicer selection doesn't return correct value

Hi,

I have a data table in below format i have a slicer based on "Slicer Date" column.

I created two [TY] and [LY] measures to do year over calculations. However when slicer a value is selected in slicer it returns 

 

 TY: = Calculate(SUM('P&L'[Values]), ALLSELECTED('P&L'[Calendar Year]))

 LY = CALCULATE(SUM('P&L'[Values]),DATEADD('P&L'[Calendar Year],-1,YEAR))  
Chg %=[TY]/[LY]-1
 
 If there is no slicer selection formulas work seemlesly however when a date is selected whether YTD, Last Mont or Last Year. It return Value for 2022 but not previous year (2021). Can someone please help me with what i am doing wrong?

 

Calendar YearP&LValuesSlicer Date
12/31/2020Sales1000 
12/31/2021Sales2000Last Year
1/1/2021Sales3000 
1/1/2022Sales4000Last Month
1/31/2021Sales5000 
1/31/2022Sales2500YTD
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @dokat 

Have you solved this question? Is there anything else I can help with? If you have solved the question, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.❤️

If you need more help, please let me know.

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

4 REPLIES 4
v-xiaotang
Community Support
Community Support

Hi @dokat 

Have you solved this question? Is there anything else I can help with? If you have solved the question, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.❤️

If you need more help, please let me know.

 

Best Regards,

Community Support Team _Tang

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

Greg_Deckler
Community Champion
Community Champion

@dokat You are going to likely need an ALL somewhere so that you can break out of the filter context set by the slicer. You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I tried the previous year function rather than dateadd but still i can't get it to work. Is it possible that it is not linking to columns together Slicer Dat and Calendar Year columns. Essentially i am asking with [LY] to look up Slicer Date Value in Calendar Year column and go back 1 year. whether with dateadd function or previous year. For some reason it doesnt work. Appreciate any help.

 

@dokat Yeah, I don't use any Time "Intelligence" functions. Because they are evil IMHO. If you are, make sure you have a separate date table and it is set to be a date table. There are alternative formulas for date intelligence in Power BI Cookbook 2nd Ed. that don't use TI functions. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors