Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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 ...
  • lbendlin's avatar
    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