Forum Discussion

LuciD's avatar
LuciD
Frequent Visitor
4 years ago
Solved

Date filtering

Hi, everyone!   I'm relatively new to Power Bi and was having trouble with implementing a date filter.   I have a database with car`s number plate and expiration date of ITP. A car may have multi...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi LuciD ,

    I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a calculated column as below:

    Validity Check = 
    VAR _maxdate =
        CALCULATE (
            MAX ( 'Table'[Expiration date] ),
            FILTER ( 'Table', 'Table'[Car number] = EARLIER ( 'Table'[Car number] ) )
        )
    RETURN
        IF (
            DATEDIFF ( TODAY (), _maxdate, DAY ) > 0,
            FORMAT ( _maxdate, "dd.mm.yyyy" ),
            "Expired. Please contact"
        )

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

    Best Regards