Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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

3 ACCEPTED SOLUTIONS
DataNinja777
Super User
Super User

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,

View solution in original post

Anonymous
Not applicable

Hi @Anonymous ,

I create a table as you mentioned.

vyilongmsft_0-1724296064237.png

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

vyilongmsft_1-1724296151466.png

Next you can enter this code:

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

vyilongmsft_2-1724296243926.png

 

 

 

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.

View solution in original post

anmolmalviya05
Super User
Super User

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 !!

View solution in original post

3 REPLIES 3
anmolmalviya05
Super User
Super User

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 !!

Anonymous
Not applicable

Hi @Anonymous ,

I create a table as you mentioned.

vyilongmsft_0-1724296064237.png

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

vyilongmsft_1-1724296151466.png

Next you can enter this code:

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

vyilongmsft_2-1724296243926.png

 

 

 

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.

DataNinja777
Super User
Super User

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,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.