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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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