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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Justas4478
Post Prodigy
Post Prodigy

Extracting first two characters to create new column

Hi, I am trying to do simple measure but it doesn't wan't to work for some reason.

I have this data: And I need to extract first two characters to create new column called gates.
For example from G1P0 I want to extract G1, same for G1P2 as well G2P0 etc.

I tried using this measure that should have worked but it isnt working for some reason.

Gate = LEFT('PickReport'[Floor],2)

Justas4478_0-1704270684546.png

Thanks

7 REPLIES 7
MFelix
Super User
Super User

Hi @Justas4478 ,

 

Measure only work with aggregations so you cannot do a LEFT. You need to select the table were you have this informaiton and add a new column, the syntax is correct.

MFelix_0-1704271206784.png

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix Hi, I cant create new column since my data connection is through power bi semantic model. Is there any other way that it can be done?

Hi @Justas4478 ,

 

What do you want to do with that new column?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix The current column has gates(warehouses) and floors in the same column. I need to have second column that has only gates without any floors.

@MFelix I tried to create using SWITCH function but it only works when I have no more than one value selected in filter.
I tried other than 'SELECTEDVALUE' but then measure just return error.

Justas4478_0-1704281723250.png

 

You want to use tihs new column in your slicer is that it?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix Yes I would like to use it as a slicer if possible.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors