Forum Discussion
Dayna
Helper V
4 years agoIf statement if date is less than today
Hello, I have an if statement, where I want to show Sales Value when the weekyearnr is less than the current week. Otherwise, use the Forecast Value. In my QlikView past I'd do: IF('Calendar...
- 4 years ago
Try this ...yes you aggregate function..TRY THIS
IF(max('Calendar'[YearWeekNr]) < [Today (Week)], [Sales Value], [Forecast Value]) + 0
Dayna
Helper V
4 years agoHi ribisht17
I assumed that too originally, but unless my syntax is wrong, it says it cannot find the field 'Calendar'[YearWeekNr]
It is written the same way as what you've listed on your message. Using something like SELECTEDVALUE then renders it fine.
I do get a little lost with syntax when referencing a measure compared to that of a field in a table, so it may be something obvious I've not done!
Sales Forecast Quantity (Month) =
IF(('Calendar'[YearWeekNr]) < [Today (Month)], [Actual Sales (ISS-SO)], [Forecast Qty]) + 0
Many thanks,
Dayna
Dayna
Helper V
4 years agoLooking at this thread, I need an aggregation function to use column fields?
https://community.powerbi.com/t5/Desktop/New-Measure-Cannot-find-name-from-table-column/m-p/2296157