Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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
Solved! Go to Solution.
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()
)
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.
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()
)
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.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |