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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Zarlot531
Helper V
Helper V

SelectedValue function not working correctly within a calculate(sum) ?

Check this out. I have sales data going back to 2018 in this dataset. The "YearMinus" shows that the 

 

Date(selectedvalue('Query1'[year])-1,1,1)

 

 produces 1/1/2021 when clicked on 2022 year. 

 

yet, the measure brings back the same exact number as the slicer, despite me wanting everything from 1/1/2021 based on 2022 being selected. Oh wait... the measure isn't able to overcome the slicer is it. The slicer is keeping this within 2022. I need a separate year table that's indepdenent. I think i figured this out actually. I'll still post it in case it helps anyone else. 

 

 

Capture3939.JPG

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Zarlot531 Not sure you need a separate table, you could use ALL or ALLEXCEPT to override the slicer filter context and then filter down to the dates you want.



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...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Zarlot531 Not sure you need a separate table, you could use ALL or ALLEXCEPT to override the slicer filter context and then filter down to the dates you want.



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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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