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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Filter for Showing YTD & MTD at the same time

Hey All, 

 

Im making a dashboard for sales leader who were used to a slide deck and they want too see MTD and YTD in the same table. I did that no problem (pic 1), as you can see both YTD and MTD have different numbers (as they should). 

DeGiacomo72_1-1645828522390.png

DeGiacomo72_2-1645828554091.png

 

 

The Issue comes when I select any Month, when I do that both number's become the same (pic 2). How do I make a filter or filters that lets me select 1 month and it shows YTD and MTD on the same table without the numbers looking like picture 2?

 

Thanks,

Matt

4 REPLIES 4
Anonymous
Not applicable

HI @Anonymous,

It sounds like you want to prevent the filter effect that applies to your expression. (your slicer has limited the expression calculation range to a specific month, so the two formulas are calculated with the same range and get the same result)
For these types of effects, I'd not so recommend you to do these with time intelligence functions. (these functions filter range has been fixed internally and you cannot do custom with their filter ranges)

I'd like to suggest you add the 'all' function to ignore the filter effect and manually apply the filter effect to your expression.

Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

In addition, you can also try to create an unconnected date table as the source of the slicer to use the slicer as a selector instead of the filter. You can use DAX expression to extract the selection value to calculate and the slicer should not be directly filtered on the fact table records.

Regards,

Xiaoxin Sheng

Ashish_Mathur
Super User
Super User

Hi,

If the year end is December and you select January as the month, then MTD and YTD will return the same figure.


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

@Anonymous Would need to see your measure formulas to know for sure, but in general, you would use ALL or ALLEXCEPT to escape your current filter context and then you reimpose your desired filter context. So, you can use SUMX(FILTER(ALL('Table'),[Year] = MAX('Table'[Year]),[Value]) for example.



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...
Anonymous
Not applicable

Hey @Greg_Deckler , 

 

I used the time intellegence formuals for MTD & YTD but for my difference measure I used Variables + Calculate. 

 

DeGiacomo72_2-1645830727636.png

 

DeGiacomo72_0-1645830641257.png

DeGiacomo72_1-1645830657614.png

Would you use that formula when making the filter table? 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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