Forum Discussion
Steven-conance
4 years agoHelper I
Calculated column using 'lookup' in same table
I'm trying to compute a caluculated column in the Calendar to show which period is current, past of future. Can't get my head around it how to do this. The difficulty is that I need my calendar to ...
- Anonymous4 years ago
Hi Steven-conance ,
According to your screenshot, I think we can determind [Period] based on [Week Start Date]. My code is based on this logic, we will calculate week start date based on today and then get period. Then use this dynamic period in switch.
Please try it to create a calculated column.
Passed/Current/Future Periods = VAR _WeekStart_Date = TODAY () - WEEKDAY ( TODAY (), 2 ) + 1 VAR _Period = CALCULATE ( SUM ( 'TableName'[Period] ), FILTER ( 'TableName', 'TableName'[Week Date Start] = _WeekStart_Date ) ) RETURN SWITCH ( TRUE (), [Period] > _Period, "Future", [Period] = _Period, "This Period", [Period] < _Period, "Past" )Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Steven-conance
4 years agoHelper I
In essence, yes. But how to make this dynamic? When we're in Period 8, it's supposed to change. Then Period 8 is the current period. And so on