Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

default calendard date not working

I have created a slicer using this logic, the requirement is  to have a detault  date that shows today + 30 days. however my logic only shows  5/2/2023 instead of 6/5/2023 . does anyone know what i n...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

    Please confirm there is the related date in "sales[date]" column firstly, then try below dax formula:

    CustomDateFilter =
    UNION (
        ADDCOLUMNS (
            DATESBETWEEN ( sales[date], TODAY (), TODAY () + 30 ),
            "Type", "Default"
        ),
        ADDCOLUMNS (
            CALENDAR ( FIRSTDATE ( sales[date] ), LASTDATE ( sales[date] ) ),
            "Type", "Custom"
        )
    )
    

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.