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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Faye1901
Helper I
Helper I

YTD Measure with Filter Context

Hi All


I have a YTD measure with a view to showing the YTD total value of some product, but it loses the filter context applied to the page. I need a YTD that keeps filter context.

See current measure here: $ Value YTD = TOTALYTD([$ Value], 'dim A - Transaction Date'[Calendar Date], allselected('dim A - Transaction Date'[Financial Year Short]), "7/31")


I'm expecting the sum of the Current Year $ from the summary table but I'm getting something totally different because of the filter context issue.snip.PNG

 
Cheers
Faye

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Faye1901 

Did the above replies helped you to solve your problem. If so please mark the solutions. 

If not, you may try ALL(Table) as the filter context.

$ Value YTD = TOTALYTD([$ Value], 'dim A - Transaction Date'[Calendar Date], All('dim A - Transaction Date'), "7/31")

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@Faye1901 

Did the above replies helped you to solve your problem. If so please mark the solutions. 

If not, you may try ALL(Table) as the filter context.

$ Value YTD = TOTALYTD([$ Value], 'dim A - Transaction Date'[Calendar Date], All('dim A - Transaction Date'), "7/31")

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @Faye1901 ,

 

I think you need to change the allselected() function to allexcept() function.

 

$ Value YTD = TOTALYTD([$ Value], 'dim A - Transaction Date'[Calendar Date], allexcept('dim A - Transaction Date'[Financial Year Short]), "7/31")

 

Please try.

 

Aiolos Zhao

 

Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

$ Value YTD = calculate([$ Value],datesytd('dim A - Transaction Date'[Calendar Date],"7/31"))


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

@Faye1901 - I agree with @lbendlin 

 

But, 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...
lbendlin
Super User
Super User

please provide sample data and expected output.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.