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
smileamile2
Resolver I
Resolver I

TOTALYTD/QTD/MTD but ignore filter in measure

I have a shipments table and a calendar table. There is a date slicer where user can select any date range.  However, I want a visual to only show the YTD, QTD, or MTD total regardless of the date range slicer. I have a second slicer "Dynamic Date Filter" where a user can select "YTD", "QTD", "MTD", or "Custom" (which then adhears to the date range slicer). I've tried the below, but do not get intended results. 

 

Note: there are other slicers that interact with the report as well, so I can't blanket ignore every filter, just the date.

 

Shipments Dynamic Date =
var selecteddate = SELECTEDVALUE('Dynamic Date Filter'[Dynamic Date])
var result =
SWITCH(TRUE(),
selecteddate="MTD", TOTALMTD(ShipmentsActivity[Shipments],'Calendar'[Date],REMOVEFILTERS('Calendar')),
selecteddate="QTD", TOTALQTD(ShipmentsActivity[Shipments],'Calendar'[Date],REMOVEFILTERS('Calendar')),
selecteddate="YTD", TOTALYTD(ShipmentsActivity[Shipments],'Calendar'[Date],REMOVEFILTERS('Calendar')),
selecteddate="Custom", [Shipments]
)
return result
 
2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi,  @smileamile2 

Could please tell me whether your problem has been solved?

If you still need  help ,please share more details.

 

Best Regards,
Community Support Team _ Eason

v-easonf-msft
Community Support
Community Support

Hi,  @smileamile2 

Try to use allselected (‘Calendar’[Date]) to replace REMOVEFILTERS('Calendar').
Allselected-function-dax

Related thread: YTD,MTD,15 Days Sales calculation based on date selection on slicer 

 

Or  edit  interaction ->select the date slicer ->disable the interaction between the date slicer and the visual.
Change how visuals interact in a Power BI report 

 

Best Regards,
Community Support Team _ Eason

 

 

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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