Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Question on New Calculated Column When Starting With A Character

Hi

 

I want a new column to show "Yes" if the reference column in the same table starts with the number "7" the rest will be "No"

 

//NT

  • Hi Anonymous ,

     

    This can be done in the same way as it would be in Excel:

    Calculated Column =
    IF ( LEFT ( 'Your table'[Reference column], 1 ) = "7", "Yes", "No" )

     

    Best regards,

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

    I create a table as you mentioned.

    Then I go to Power Query and select Add Column, select Custom Column.

    Next you can enter this code:

    Custom = if Text.StartsWith(Text.From([Column]), "7") then "Yes" else "No"

     

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hi Anonymous, Hope you are doing well!

    You can achieve this by creating a new calculated column using below formula:

    StartsWith7 =
    IF(
    LEFT(TableName[ReferenceColumn], 1) = "7",
    "Yes",
    "No"
    )

    Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

3 Replies

  • Hi Anonymous ,

     

    This can be done in the same way as it would be in Excel:

    Calculated Column =
    IF ( LEFT ( 'Your table'[Reference column], 1 ) = "7", "Yes", "No" )

     

    Best regards,

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    I create a table as you mentioned.

    Then I go to Power Query and select Add Column, select Custom Column.

    Next you can enter this code:

    Custom = if Text.StartsWith(Text.From([Column]), "7") then "Yes" else "No"

     

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hi Anonymous, Hope you are doing well!

    You can achieve this by creating a new calculated column using below formula:

    StartsWith7 =
    IF(
    LEFT(TableName[ReferenceColumn], 1) = "7",
    "Yes",
    "No"
    )

    Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!