Forum Discussion
Date filtering
- Anonymous4 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
Hi, goncalogeraldes
I tried as a measure, as u suggest. I dind`t received an error, but it brings me the same date as "Expiration date" . Doesn`t check in my database for a max date for that car number.
- Anonymous4 years agoNot applicable
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