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
sakshikaul
Helper III
Helper III

Managing custom filter

HI 

In  below given data model I am getting values for a particular column (carrier type as NPC , NPC, OTHERS, PC).

I want to create a custom column as carrier_type_new where  NPC values should be trated as a single value 

so how to manage this?

sakshikaul_1-1614855100430.png

 

 

1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

Hi @sakshikaul ,

 

I see there is a space in NPC value in one instance so there can be 2 ways of fixing this.

  1. You can create a calculated column likeas below:

    NewGrouping = 

    IF(yourColumn = "NPC" || yourColumn = " NPC", "NPC", yourColumn)

  2. Go to Query Editor (Transform Data) in Power BI, then click on your column which has these above values. Right click on it --> Transform --> Trim. This will remove that extra space that you are seeing against "NPC" value.  See below: (I generally follow this transformation step when dealing with TEXT values)

     t1.png

     

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

1 REPLY 1
Pragati11
Super User
Super User

Hi @sakshikaul ,

 

I see there is a space in NPC value in one instance so there can be 2 ways of fixing this.

  1. You can create a calculated column likeas below:

    NewGrouping = 

    IF(yourColumn = "NPC" || yourColumn = " NPC", "NPC", yourColumn)

  2. Go to Query Editor (Transform Data) in Power BI, then click on your column which has these above values. Right click on it --> Transform --> Trim. This will remove that extra space that you are seeing against "NPC" value.  See below: (I generally follow this transformation step when dealing with TEXT values)

     t1.png

     

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.