Forum Discussion

EaglesTony's avatar
EaglesTony
Post Prodigy
9 months ago
Solved

How do I get a unique list ?

hi,    I have the following data:    IDENTITY RoleName    RolePersonName 111            Cook             John Doe 111            Waitress        Jane Doe 111            Cook             Karen ...
  • BA_Pete's avatar
    9 months ago

    Hi EaglesTony ,

     

    In Power Query you would use the Table.Distinct() function.

    Your two new tables (if you want them to be new tables) would be created as follows:

    -1- Reference your main table into two new queries

    -2- Remove the column that won't be used in each.

    -3- Press Ctrl+A to select the whole table (or Ctrl+Click both columns you want to have unique combinations of).

    -4- Go to the Home tab > Remove Rows > Remove Duplicates.

     

    This should create a new code line something like this:

    = Table.Distinct(Source, {"IDENTITY", "RoleName"})

     

    Pete

  • grazitti_sapna's avatar
    9 months ago

    Hi EaglesTony ,

     

    Please follow these steps to get the result:

    1. In Home Tab, go to transform data, It will open power query editor for you.(Home β†’ Transform Data β†’ Power Query Editor.)
    2. Right Click your main table and duplicate it and rename it 'Distinct Rolnames'
    3.Select two columns that are needed holding CTRL and select Identity and Rolename and right click and select remove other columns.
    4.Again select both the columns holding CTRL and select Identity and Rolename and right click and select remove duplicates or (Home β†’ Remove Rows β†’ Remove Duplicates.)
    Now you can see the desired output.

    5. Click Close and Apply.
    6.Similar steps please follow for the 2nd output.
    7. If you see summarization sign in front of identity  in Fields section then change it to "Do Not Summarize". It will wont add up the identity column and will give you desired output.

     

    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.

    πŸ’‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.

    πŸŽ– As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.

    πŸ”— Curious to explore more? [Discover here].

    Let’s keep building smarter solutions together!