Forum Discussion

saranp780's avatar
saranp780
Icon for Helper III rankHelper III
8 years ago

How to Grouping Some username (Categorize)

I have data in the table below.

 

User Name
ACTSUP003
ACTSUP004
ACTSUP004.1
ACTSUP004.2
JVSKACT001
JVSKACT002
JVSKACT003
JCSKACT004
JVSKCM001
JVSKCM002
JVSKCM003
JVSKCO001
JVSKCOE001
PJACTOF1402B
PJACTOF1503A
PJACTOF1602
PJACTOF1602A
PJACTOF1602B
PURMGR001
PURMGR001.1
PURMGR002
PUROFFLINE

Now, I want to group the username in the next column such as table below.

User NameCategory
ACTSUP003ACT
ACTSUP004ACT
ACTSUP004.1ACT
ACTSUP004.2ACT
JVSKACT001ACT
JVSKACT002ACT
JVSKACT003ACT
JCSKACT004ACT
JVSKCM001CM
JVSKCM002CM
JVSKCM003CM
JVSKCO001CO
JVSKCOE001OE
PJACTOF1402BACT
PJACTOF1503AACT
PJACTOF1602ACT
PJACTOF1602AACT
PJACTOF1602BACT
PURMGR001PUR
PURMGR001.1PUR
PURMGR002PUR
PUROFFLINEPUR

Who knows how DAX can I use? Please help me how to make category using the keywords from data.

 

 

Best regard.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI saranp780,

     

    Based on your sample data, I haven't found any logic about how to choose specific characters as the category.
    Can you please share more detail about this?

     

    Regards,

    Xiaoxin Sheng

    • saranp780's avatar
      saranp780
      Icon for Helper III rankHelper III

      I've thought that I can put it together by using the keyword such as ACTSUP001 , ACTSUP002 I will put them in ACT group because they have "ACT" in their text. But I don't know DAX that I can use.

  • saranp780 on which basis are you making these categories for exampe 

     

    1) ACTSUP003  First 3 Letters ACT Which is fine 

    2) JVSKCM001 how did you get CM (No Clue)

    3) PJACTOF1402B how did you get ACT (No Clue) 

    .

    .

    .

     

    IF you can give your logic so that we can use String functions to get the requierd out put you can add as custom column and we will use power query to get this done .

     

    Please give me exact logic and exact data so that we can resolve this.!!!!!!!!!1

    • saranp780's avatar
      saranp780
      Icon for Helper III rankHelper III

      2) JVSKCM001 how did you get CM (No Clue) ---> CM is the keyword JVSKCM001

      3) PJACTOF1402B how did you get ACT (No Clue) ---> ACT is the keyword PJACTOF1402B

      • BalaVenuGopal's avatar
        BalaVenuGopal
        Icon for Resolver I rankResolver I

        Hi saranp780

         

        From this conversation i undetstood  is that you have mapping for username and keyword. In this case you can do the following.

        1) Create table from model (static table) and create two columns (UserName and Key)

        2)  Insert your UserName and Key into this table (Unique values)

        3) Then join this table with your transactional table .(Join column UserName)

        4) Create custom column [use related function to get key from the table you created] in the transactional table.

         

         

        Then you will get Username and key in same table .

         

        Hope this will get what you need please mark this as solution if you got the expected result.

         

        Regards,

        Venu Gopal.