Forum Discussion
Anonymous
5 years agoNot applicable
Correct Power Query Syntax to reflect month and year?
I'm new to Power BI and Power Query and having a hard time finding the correct way to write the syntax for a simple if then statement using month and year. In my if function, one of the parameters I ...
- 5 years ago
You are close. Use Date.Month and Date.Year for the comparisons.
if Date.Month(a)=Date.Month(b) and Date.Year(a)=Date.Year(b) then x else y
lbendlin
5 years agoSuper User
if Date.Year([Actual Finish]) <= 2021 and Date.Month([Actual Finish]) <= 1 then "1" else "0"