Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

I am trying to add some custom columns using Power Bi 

= Table.AddColumn(#"Filtered Rows", "IsCurrentMonth",  if(Date.Month([Timestamp])=Date.Month(NOW())) then "Current Month" else "Other")

but getting an error message

Expression.Error: The name 'NOW' wasn't recognized. Make sure it's spelled correctly. 

How can I get current month? 

1 Answer

0 votes
by (22.5k points)

Use the following measure:

= Table.AddColumn(#"Filtered Rows", "IsCurrentMonth",  if(Date.Month([Timestamp])=Date.Month(DateTime.LocalNow())) then "Current Month" else "Other")

Want to learn more about Power BI? Check out today: Power BI course      

Related questions

0 votes
1 answer
asked Dec 27, 2020 in BI by Chris (11.1k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...