Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Getting error trying to create a custom column in the transformation

I have a report the data is structured (in Excel) as per example:

BuildingSiteEstimatedRepairDateActualRepairDateEstimatedNumberofOffices
Northeast8/1/20228/12/20225
Southeast9/10/20229/2/22210
Central/midwest9/1/2023 50
Southeast7/1/2021 9
Southwest9/5/20229/5/20222
West8/1/2022 3

 

I tried creating a custom column that will calculate the completed number of offices based on ActualRepairDate is null

 

= Table.AddColumn("Completed Business Sites", each if [#"ActualRepairDate"] <> null then [#"EstimatedNumberofOffices"] else 0)

I'm getting error which is "Token Comma expected". When I click on show error, it really does not show anything. However the red line is right on [#"EstimatedNumberofOffices"] line.

 

I'm stumped and struggling with this.. Appreciate your help.

  • Hi Anonymous ,

     

    Try using the conditional column as below.

     

     

    Hope this helps.

    Did I help you today? Please accept my solution and hit the Kudos button.

5 Replies

  • davehus's avatar
    davehus
    Memorable Member

    Hi Anonymous ,

     

    Try using the conditional column as below.

     

     

    Hope this helps.

    Did I help you today? Please accept my solution and hit the Kudos button.

  • davehus's avatar
    davehus
    Memorable Member

    Hi Anonymous , is the measure above what you've actually written into the custom column or is it a copy from advanced editor?

     

    Did I help you today? Please accept my solution and hit the Kudos button.

    • Anonymous's avatar
      Anonymous
      Not applicable

      You have helped! Thank you so much. I have accepted your solution. It worked. Now I know how to do this going forward. Thank you again!!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi davehus,

    I wrote it into the custom column.