Forum Discussion

prabhuk's avatar
prabhuk
Icon for Helper I rankHelper I
5 years ago
Solved

Group Customer

Hello!

I have about 100 customers in my table from whcich i need to create a measure to select sepcific two customers rest of the customers grouped uder "all others". Example: Customer A and Customer B and All others. Is there any way to solve this requeirement?

 

Prabhu

  • hi, prabhuk 

     

    It’s my pleasure to answer for you.

    According to your description,If the original ‘customer’ column doesn't appear in your table, It's recommended to use a calculated column to display.

    Like this:

    Column = SWITCH (
        TRUE(),
        'Table'[Customer]="AA","A",
        'Table'[Customer]="BB","B",
        "All Others"
        )

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Hi prabhuk 

    If you can supply your actual data it makes things easier, but I've ceated some dummy data you can download in this PBIX file.

    With a table like this

    You can create this measure

     

    Measure = SWITCH (
    
        TRUE(),
    
        CONTAINSSTRING(MIN('Table'[Customer]) , "AA"), "Customer",
    
        CONTAINSSTRING(MIN('Table'[Customer]) , "BB"), "Customer",
    
        "All Others"
        
        )

     

    Which gives you this

    Regards

    Phil


    If I answered your question please mark my post as the solution.
    If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.

    • prabhuk's avatar
      prabhuk
      Icon for Helper I rankHelper I

      Thanks,

       

      When i select measure along with sale value ,it is relfecting as customerA not as Customer A and Customer B and all others . I have attached the File for your reference. Kindly help to have measure in row  as Customer A, Custome B and All others and Sales in Value column.

      https://www.dropbox.com/s/ebdltaemwfbqg9l/prabhuk.pbix?dl=0

      • v-janeyg-msft's avatar
        v-janeyg-msft
        Icon for Community Support rankCommunity Support

        hi, prabhuk 

         

        It’s my pleasure to answer for you.

        According to your description,If the original ‘customer’ column doesn't appear in your table, It's recommended to use a calculated column to display.

        Like this:

        Column = SWITCH (
            TRUE(),
            'Table'[Customer]="AA","A",
            'Table'[Customer]="BB","B",
            "All Others"
            )

        If it doesn’t solve your problem, please feel free to ask me.

         

        Best Regards

        Janey Guo

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Create a calculated column in your table for instance CustomerGroup with the logic

    IF Customer = "customer a" or Customer =  "customer b" THEN customer ELSE "Other"

     

    Create a slicer on the new column