Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
14 | |
11 | |
8 |
User | Count |
---|---|
24 | |
19 | |
12 | |
11 | |
10 |