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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
admin11
Memorable Member
Memorable Member

How to recode Blank and Grace as Other ?

Hi All

 
Below syntax work fine  @v-yangliu-msft :-
 
GROUP_class_CO =
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE('SALES'[GROUP_CLASS_],
"G02","PAUL"),
"1","GRACE"),
"2","HELENE")
 

admin11_0-1617798992335.png

My PBI file :-

https://www.dropbox.com/s/bnbodhork69xenx/PBT_V2021_396%20TI_SI_GL%20SAMPLE.pbix?dl=0

 

Paul

1 ACCEPTED SOLUTION

Hi @admin11 

Please try these codes:

GROUP_class_CO_NEW = 
IF ( SALES[GROUP_class_CO] IN { "GRACE", "" }, "Others", SALES[GROUP_class_CO] )

040902.jpg

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@admin11 , Try a new column like

 

GROUP_class_CO =
if( isblank('SALES'[GROUP_CLASS_]) || search("1",'SALES'[GROUP_CLASS_],,0)>0, "Others",
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE('SALES'[GROUP_CLASS_],
"G02","PAUL"),
"1","GRACE"),
"2","HELENE"))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Thank you for sharing , actually my requirement is i need to combine Blank and Other. may i know how to achieve this ?

admin11_0-1617802353276.png

 

Hi @admin11 

Please try these codes:

GROUP_class_CO_NEW = 
IF ( SALES[GROUP_class_CO] IN { "GRACE", "" }, "Others", SALES[GROUP_class_CO] )

040902.jpg

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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