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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
DavidCunningham
Frequent Visitor

Using DAX to incorporate the results of a slicer

I have built a dashboard that has a Month to Date (MTD) and Year to Date (YTD) slicer. The slicer works as a file parameter which selects different DAX incoporating a MTD and YTD filter.

 

I want to add a "custom date" option on the filter, which will send back values incoprating a seperate date filter (i.e. someone wants to see data from January, February and July, so they select that in the date silcer and then select the custom date option on the other slicer.

 

I think i need to build DAX to do this (like i have with YTD and MTD) Im just not sure how. 

 

Thanks 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @DavidCunningham ,

Based on the knowledge, creating a measure based on the custom date.

CustomDateMeasure = CALCULATE(
       SUM('Table'[Number]),
       'Table'[Month] IN VALUES('Table'[Month])
   )

Then, creating another measure to filter slicer values.

Measure = 
var _selected = SELECTEDVALUE('Option Table'[Option])
RETURN
SWITCH(
       TRUE(),
       _selected = "MTD", [MTDMeasure],
       _selected = "YTD", [YTDMeasure],
       _selected = "Custom Date", [CustomDateMeasure],
       BLANK()
   )

vjiewumsft_0-1733993354680.png

Best Regards,

Wisdom Wu

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

1 REPLY 1
Anonymous
Not applicable

Hi @DavidCunningham ,

Based on the knowledge, creating a measure based on the custom date.

CustomDateMeasure = CALCULATE(
       SUM('Table'[Number]),
       'Table'[Month] IN VALUES('Table'[Month])
   )

Then, creating another measure to filter slicer values.

Measure = 
var _selected = SELECTEDVALUE('Option Table'[Option])
RETURN
SWITCH(
       TRUE(),
       _selected = "MTD", [MTDMeasure],
       _selected = "YTD", [YTDMeasure],
       _selected = "Custom Date", [CustomDateMeasure],
       BLANK()
   )

vjiewumsft_0-1733993354680.png

Best Regards,

Wisdom Wu

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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