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