Forum Discussion
IF Condition
Hi gooday can anyone correct my If condtion. What i need is if the week is already pass it should be equal to 0, so from Week 1 to 11 it should be zero and from Week 12 onward should be equal to my forecasthour
Hii AllanBerces
Your logic is slightly incorrect. You should compare the week column with the current week (WEEKNUM(TODAY())), not the forecast value.
FORECAST = IF( 'Table'[Week] < WEEKNUM(TODAY()), 0, 'Table'[FORECASTHOURS] )
3 Replies
- rohit1991Super User
Hii AllanBerces
Your logic is slightly incorrect. You should compare the week column with the current week (WEEKNUM(TODAY())), not the forecast value.
FORECAST = IF( 'Table'[Week] < WEEKNUM(TODAY()), 0, 'Table'[FORECASTHOURS] )- AllanBercesPost Prodigy
Hi rohit1991 thnak you very much work as i need
- RehanM9New Member
Nice solution, That makes perfect sense, comparing the week number directly instead of the forecast hours is definitely the way to go. Clean and logical fix.
On a side note, if anyone here likes to unwind after troubleshooting DAX formulas by streaming or storing files, you might want to check out Terabox for cloud storage and Wink for editing and sharing videos. Pretty handy tools!