Forum Discussion
HenryJS
Post Prodigy
6 years agoIF date values in last week return 1
Hi all,
Please could you advise the DAX for below query
IF
- EITHER: PlacementDate is in the last 7 days
- OR ExtensionEndDate is in the last 7 days
THEN 1
ELSE 0
Thanks,
Henry
- Anonymous6 years ago
Should work like this:
Column =IF(Table[Placementdate] >=TODAY() - 7 ||Table[ExtensionEndDate ] >= TODAY - 71,0) - Anonymous6 years ago
Simply remove the equal operator from the second part of the two conditions, the ones that check that date is <=today. Just put inferior to today.
7 Replies
- AnonymousNot applicable
Should work like this:
Column =IF(Table[Placementdate] >=TODAY() - 7 ||Table[ExtensionEndDate ] >= TODAY - 71,0)- HenryJS
Post Prodigy
That only returns values that are both those statements
How do I return values
IFTable[Placementdate] >=TODAY() - 7ORTable[ExtensionEndDate ] >= TODAY - 7- AnonymousNot applicable
The double pipe is equivalent to the OR operator. It should return 1 if either one of the mentioned conditions is true. Are you sure it's interpreting it as an AND condition? It would be very weird