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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
admin11
Memorable Member
Memorable Member

How to make Brand recode only return 3M ?

Hi All

 

I have field name BRAND_5 , it have 4 value lable , for example :-

3.0

3M

400A

4MM

 

I have below expression :-

 

BRAND_F =
SUBSTITUTE(
SUBSTITUTE('SALES_T'[BRAND_5],
"3M","3M"),
"3.0","3M")
 
Now it return as below :-

3M

400A

4MM

 

 May i know how to make it return :-

3M

 

Paul Yeo

1 ACCEPTED SOLUTION

@admin11  If you want to add a new column, try this:

 

BRAND_F = 
Var _A = 
SUBSTITUTE(
SUBSTITUTE('SALES_T'[BRAND_5],
"3M","3M"),
"3.0","3M")
return
if(_A="3M",_A,blank())

 

 

output:

VahidDM_0-1641855694367.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

 

View solution in original post

8 REPLIES 8
VahidDM
Super User
Super User

HI @admin11 

 

It already returend 3M, can you add more details about your expected output?


Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

@VahidDM 

I only want it return 3M only.

i mean i don't want the rest of value label to be appear.

@admin11  If you want to add a new column, try this:

 

BRAND_F = 
Var _A = 
SUBSTITUTE(
SUBSTITUTE('SALES_T'[BRAND_5],
"3M","3M"),
"3.0","3M")
return
if(_A="3M",_A,blank())

 

 

output:

VahidDM_0-1641855694367.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

 

@VahidDM 

wHEN i try to apply the expression to my actual PBI file , i get error , i cannot figure out where i go wrong , by looking at the error code. in case you have any hint , do share with me.

admin11_0-1641911349028.png

 

@VahidDM 

Today i try to copy your orginal code to my actual power PBI file , and from there i slowly modify the

- 3M to UR

- 3M to UNIVERSAL

no error now

Thank

@VahidDM 

Thank you very much it work fine now. 

Very nice code easy to understand.

@admin11 

 

Do you want it as a column, table or measure? how do you want to use it?

 


Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

@VahidDM 

I need it as column.

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.