this power bi dax needs to start week from tuesday not monday and put 1 next to current…
- User
this power bi dax needs to start week from tuesday not monday and put 1 next to current week based on Week Com column, not today
CurrentWeekFlag = VAR CurrentMonday = TODAY() - WEEKDAY(TODAY(), 2) + 1 RETURN IF('Braiding Efficiency'[Week Com] = CurrentMonday, 1, 0)
- Assistant
To modify your DAX formula to start the week from Tuesday instead of Monday and to set the current week flag based on the
Week Comcolumn rather than today's date, you can adjust your calculation as follows:CurrentWeekFlag = VAR DayOfWeek = WEEKDAY(TODAY(), 2) // Returns a number from 1 (Monday) to 7 (Sunday) VAR DaysToSubtract = MOD(DayOfWeek - 2, 7) // Calculates days to subtract to get to the most recent Tuesday VAR CurrentTuesday = TODAY() - DaysToSubtract // Calculates the date of the current week starting Tuesday RETURN IF('Braiding Efficiency'[Week Com] = CurrentTuesday, 1, 0)