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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
POWER_MI
Post Patron
Post Patron

Special format of name of colonnes on table

Hi, 

I have another questions about coloones updates on data base table. 

 

On Power Bi the source of data is excel file and in this excel file for example all values of colonne1 have more caractere that when we try to do some Kpi table it's will be long table Colonnes 1 ....Number_name table ...

The asking is i need to create New colonne where the Colonnes 1 values will be formated.

 

For example Values Colonnes 1

value_1_abcd---------------- > On new Colonne it will be Value1

value_2_abco---------------- > On new Colonne it will be Value2

value_3_abcd---------------- > On new Colonne it will be Value3

value_4_abcd---------------- > On new Colonne it will be Value4

value_5_abcd---------------- > On new Colonne it will be Value5

 

Can you give one if condition will all this 

thanks 

 

 

 

Capture6.PNGCapture9.PNG

1 ACCEPTED SOLUTION

I find solution
Colonne = SWITCH(TRUE (),'table'[oldvalue]= "value1_abcd1s2254", "value1", "UNKNOWN")
it's work
thanks

View solution in original post

6 REPLIES 6
tex628
Community Champion
Community Champion

It sounds like you need to use the "Split by delimiter" functionality in Power Query:

image.png 

Let me know how it goes!

/ J


Connect on LinkedIn

Hi Friend,

thansk for feed back.

I will create new colonne and in this colonne i will make

Values Old colonnne with New format with replacing

value_1_abcd---------------- > BY In the new Colonne will be Value1

so it's will be done like this

New colonne on table

and contain of this colonne will be :

Value 1

Value2....

so it's will be if condition with if ... ( 'old colonnne contain value1', value1)....

tex628
Community Champion
Community Champion

Alright so it's a new column like this:

Old column New Column
Value_1_ABC Value1
Value_2_ABC Value2
Value_3_ABC Value3
Value_4_ABC Value4


I'm assuming your actual values are different to your examples so it's quite hard to propose an exact solution. 

You can use LEFT( [Old_Column] , X )
https://docs.microsoft.com/sv-se/dax/left-function-dax
This takes X number of characters from the left. 

You can use SWITCH( [Old_Column] , "Value_1_ABC" , "Value1" , "Value_2_ABC" , "Value2" ) 
https://docs.microsoft.com/en-us/dax/switch-function-dax
This looks for specific values and switches them if it finds them.

From what you're writing in the end i believe that the switch is right for you. 

/ J



Connect on LinkedIn

Hi,

i have take this solution

New Colonne = IF('OLD'[Value]'="value1_abcdffsfs", "value1")
Error ?
Colonne = SWITCH('OLD'[Value]'="value1_abcdffsfs", "value1")
error also
tex628
Community Champion
Community Champion

Can you post a picture of the error?


Connect on LinkedIn

I find solution
Colonne = SWITCH(TRUE (),'table'[oldvalue]= "value1_abcd1s2254", "value1", "UNKNOWN")
it's work
thanks

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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