Forum Discussion
Auto Select Previous Day
- Anonymous2 years ago
Hi AllanBerces ,
I created a Date table:
Date = CALENDAR(DATE(2024,3,1),DATE(2024,4,3))A measure is created to dynamically represent today, or "today" if it is today.
Measure1 = IF(MAX('Date'[Date]) = TODAY(), "Today",MAX('Date'[Date]))Creates a measure to dynamically represent the day before today, or "Previous_day" if it is the day before today.
Measure2 = IF(DAY(TODAY()) - DAY(MAX('Date'[Date])) = 1, "Previous_day",MAX('Date'[Date]))The calculated columns cannot be created and the following error is reported: "Expressions that yield variant data-types cannot be used to define calculated columns."
The page effect is shown below:
If you have other questions please feel free to contact me.
The pbix file is attached.
Best Regards,
Yang
Community Support TeamIf 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!