Forum Discussion

sakshikaul's avatar
sakshikaul
Helper III
5 years ago
Solved

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?

 

 

  • 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)

       

       

    Thanks,

    Pragati

     

1 Reply

  • 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)

       

       

    Thanks,

    Pragati