• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Date slicer applied filter not fully working

jutu

Member
Hi. I've tried to attached an small PBIx file but it's not accepted.
I've created the below DAX which I've thrown in a slicer and it works fine. All the options are there. Then, for the 'Custom' Type I've created another DAX as below 'Data Slicer Filter' which I have added to the date slicer to filter '1' so that the dates slicer is actionable only when I tick on the 'Custom' type option.

However, as you can see on the attached when I tick anything but Custom, both dates in between should be grayed out but only the right side of the slicer is greyed out and the other can be amended which is not the desired result.
Also, in order to only display days up to today I have created this DAX but it doesn't do anything;
Is Before Today = IF(ALL('Semantic FactCommunications'[LetterSentDate]) <= TODAY(), TRUE, FALSE )

Thank you for your time I really appreciate it

DATES SLICER DAX;
Date Slicer Filter = IF(
SELECTEDVALUE('Date Periods'[Type]) = "Custom", 1, 0)


Date Periods =
UNION(
ADDCOLUMNS(
CALENDAR(MIN('Semantic FactCommunications'[LetterSentDate]),MAX('Semantic FactCommunications'[LetterSentDate])), "Type", "Custom",
"Order", 1),
ADDCOLUMNS(
CALENDAR(MIN('Semantic FactCommunications'[LetterSentDate]),MAX('Semantic FactCommunications'[LetterSentDate])), "Type", "All Time",
"Order", 2),
ADDCOLUMNS(
DATESMTD('Semantic FactCommunications'[LetterSentDate]), "Type", "MTD",
"Order", 3),
ADDCOLUMNS(
PREVIOUSMONTH('Semantic FactCommunications'[LetterSentDate]), "Type", "Previous Month",
"Order", 4),
ADDCOLUMNS(
DATESYTD('Semantic FactCommunications'[LetterSentDate]), "Type", "YTD",
"Order", 5),
ADDCOLUMNS(
PREVIOUSYEAR(DATESYTD('Semantic FactCommunications'[LetterSentDate])), "Type", "Last Year",
"Order", 6),
ADDCOLUMNS(
DATESQTD('Semantic FactCommunications'[LetterSentDate]), "Type", "QTD",
"Order", 7),
ADDCOLUMNS(
PREVIOUSQUARTER('Semantic FactCommunications'[LetterSentDate]), "Type", "Previous QTD",
"Order", 8))
 

Attachments

  • Date Slicer.docx
    31.7 KB · Views: 5
Hello JUTU
If you're facing issues with your Power BI date slicer and DAX logic. I can offer some suggestions to help resolve the problems you mentioned:

1. Custom Type Graying Issue:
- Ensure that the 'Date Slicer Filter' DAX expression is correctly evaluating to 1 when the 'Custom' type is selected. Check the values in your 'Type' column to ensure there are no unexpected differences.
- Verify that the slicer visual is using the 'Date Slicer Filter' measure to control its behavior.

2. Limiting Dates to Today:
- Try modifying the 'Is Before Today' DAX as follows:

Code:
Is Before Today = IF('Semantic FactCommunications'[LetterSentDate] <= TODAY(), TRUE, FALSE )

- Ensure that the 'Is Before Today' measure is applied appropriately in your visualizations.

3. Debugging:
- Use the DAX Studio or Power BI's built-in DAX editor to evaluate and debug your DAX expressions.
- Check the data types of your date columns to avoid unexpected behavior.

Remember to refresh your data after making changes to DAX measures. If the issues persist, further details about your data structure and desired outcomes might help in providing more precise assistance.
 
Back
Top