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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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

Power BI Monthly Update - September 2025

Check out the September 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.