Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Here you go @Anonymous
I removed your calculated column. With this, you have 1 correct column in the model, not an incorrect column and a calculated column.
This is what is in the model now.
And here is your PBIX file back with the working code.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting@Anonymous
I know why the previous DAX formula doesnot work. There are empty values in the brand_c column.
So len(brand_c)-3 is a negative value. Right function can't select negative postions from the right side.
If you want to use DAX, you can try this.
Column =
VAR a=len('TABLE'[BRAND_C])
return if(a=0,blank(),right('TABLE'[BRAND_C],a-3))
Proud to be a Super User!
@Anonymous
you can still use the similar solutiont that @edhans provided.
try to put a space in the Delimiter field.
Proud to be a Super User!
Hi Ryan
I start to see the benefit of using power quart for recode , which is very powerful and easy
Yes @Anonymous - try to do this in Power Query. That is what it is designed for. You cannot properly model this in DAX at all. You can get a DAX command to give you the correct column you want, but:
THat said, this will work with your data, but I would NOT recommend this path given you can do this in Power Query with the steps I've shown.
Column =
VAR varSearchPosition = SEARCH(" ", 'TABLE'[BRAND_C], 1, 0)
RETURN
IF(
varSearchPosition > 0,
TRIM(RIGHT('TABLE'[BRAND_C], LEN('TABLE'[BRAND_C]) - varSearchPosition)),
'TABLE'[BRAND_C]
)
Using Power BI as if Power Query didn't exist is going to severely limit the product and your reports. That is why Power Query is built into the product. If everything could and should be done with DAX, Power Query wouldn't be included.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi sir
thank you for sharing .
In Power Query, select that column
Select the Transform tab, then the Extract dropdown, then Text After Delimiter
Type "34 " (34 with a space) in the dialog box. It will keep everything after 34_
Then close and load.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi Edhans
Thank you for your sharing.
since my raw data , not all the number 34 , it consist of 01 till 99 number. May i know how to does using expression.
@Anonymous use the Text After Delimiter option, and just use a space. It will keep all data after the first space.
If that still doesn't answer your question, can you post some valid and fairly complete data? This won't work if some have dashes, or commas, etc. We need to see a good set of data to truly help, as the 34 BECKHOFF example wasn't comprehensive enough. 👍
While the Calculated Columns will work above, I would advise modeling your data in Power Query as Calculated Columns take up more memory and can slow the model down. If you do it in Power Query, the data comes in clean. I use that kind of logic within measures, but if I truly need to change the data in a column, use a custom column inside Power Query if possible.
In general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables
SQLBI Video on Measures vs Calculated Columns
Creating a Dynamic Date Table in Power Query
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi Sir
Yes i am still faving issue , thank you for wanted to help me.
Below is my sample file.
https://www.dropbox.com/sh/p7rthofiytivl3a/AAATCWVgNLyQ0lm_DZ65CClSa?dl=0
@Anonymous
I know why the previous DAX formula doesnot work. There are empty values in the brand_c column.
So len(brand_c)-3 is a negative value. Right function can't select negative postions from the right side.
If you want to use DAX, you can try this.
Column =
VAR a=len('TABLE'[BRAND_C])
return if(a=0,blank(),right('TABLE'[BRAND_C],a-3))
Proud to be a Super User!
Hi Sir
I just want to apply the script into my PBI file , i realise that it not work again.
Hope you can share your PBI file which is working for recode 34 Beckhoff to Beckhoff. Not sure where i make mistake ?
Hi Ryan
When i apply your script to my actual PBI file , now it does not work again. The error msg is :-
An argument of function 'RIGHT' has the wrong data type or has an invalid value.
https://www.dropbox.com/s/qsh185085pr4grc/SI_TDS_V009.pbix?dl=0
Above is my PBI file
Paul
Here you go @Anonymous
I removed your calculated column. With this, you have 1 correct column in the model, not an incorrect column and a calculated column.
This is what is in the model now.
And here is your PBIX file back with the working code.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi edhans
Thank you very much for the video , may i know how to create the video ? can i have the software name ?
Paul
It is called ScreenToGif @Anonymous
Glad I was able to help you get going. Always try to model (transform/change) your data in Power Query if possible. That is what it is designed for. Use DAX for the analysis of data. That is what the "A" in DAX stands for after all. 😁
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi edhans
Thank you for sharing with me the power of power quary. i iwll try to find out more .
Paul
@Anonymous -
Create a calculated column as-
Hi sir, Thank you for sharing , i get error msg below :-
Hi @Anonymous
Use RIGHT(SELECTEDVALUE([ColumnName]), LEN([ColumnName])-3)
Hope this Helps,
Cheers,
Namish B
Hi Sir
Thank you for sharing , i still get error :-
Hi, @Anonymous
You just need to delete "use" before the dax Statement, copy this measure:
New Column=RIGHT(SELECTEDVALUE([BRAND_C]), LEN([BRAND_C])-3)
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!