Forum Discussion

LME's avatar
LME
Frequent Visitor
2 years ago
Solved

Two Date Columns in a slicer using DAX

 Hello everyone,   This is my first time posting here and will be using this forum more. Now on to my question:   I have a requirement where I need to showcase a count between two columns using a...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi LME ,

    Please try:

    Measure = 
    VAR _min_date = MIN('Dates'[Date])
    VAR _max_date = MAX('Dates'[Date])
    VAR _result = 
    CALCULATE(
        COUNTROWS('Table'),
        ('Table'[Date1]>=_min_date && 'Table'[Date1]<=_max_date)
        || ('Table'[Date2]>=_min_date && 'Table'[Date2]<=_max_date)
    ) + 0
    RETURN
    _result

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum