Forum Discussion

Pietro_Andora's avatar
Pietro_Andora
Regular Visitor
4 years ago
Solved

Adding Semester Collumn From Already Existing Collumn Numerating Months From 1 to 12 in Power Query

Hello everyone!

 

It should be quite simple, but im struggling.

 

Im trying to create apersonalized column with this statement

             "if [month_number] <7 then 1 else 2"

 

Obviously is not working. I already have the month number under the "mês" column. Any help is apreciated.

 

2 Replies

  • Pietro_Andora , Is month_number is mês ?

     

    new column

    = if [mês] <7 then 1 else 2

     

    or

     

    if Date.Month([Data] <7 then 1 else 2

    • Pietro_Andora's avatar
      Pietro_Andora
      Regular Visitor

      Hey Amitchandak! Thanks for the answer, as the code itself had no error, found out that the column should be an integer number, found on this post (link)! After that, everything worked out just fine, thank you for the confirmation of the code!