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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
v-jiewu-msft
Community Support
Community Support

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
v-jiewu-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.