Reply
tomsuare
Frequent Visitor
Partially syndicated - Outbound

Get new table containing unique values from existing table.

Hello Everyone I have a dataset that looks like this and want to get a table containing only unique values. 

 

Employee IDCompany Worked
123CompanyCars
345

CompanyCars

678CompanyBus
123CompanyAircrafts


And the goal is to get unique values in another table that looks like this either by using power query or dax: 

Employee IDCompany Worked
123CompanyCars
345

CompanyCars

678CompanyBus
2 ACCEPTED SOLUTIONS
FreemanZ
Super User
Super User

Syndicated - Outbound

hi @tomsuare 

try to create a calculated table like:
table = 
ADDCOLUMNS(
   VALUES(TableName[Employee ID]),
   CALCULATE(MAX(TableName[Company Worked]))
)

View solution in original post

v-jingzhang
Community Support
Community Support

Syndicated - Outbound

Hi @tomsuare 

 

Here is one option with Power Query. Use Group By feature. 

vjingzhang_0-1675911462498.png

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Syndicated - Outbound

Hi,

In the Result table, why have you chosen Cars over Aircrafts for Employee ID 123? 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound

Edited due to misstyping.

Syndicated - Outbound

Your question is still not clear.  Do you want to keep the active rows or the inactive rows?  Take a larger dataset, explain the question in simple English and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-jingzhang
Community Support
Community Support

Syndicated - Outbound

Hi @tomsuare 

 

Here is one option with Power Query. Use Group By feature. 

vjingzhang_0-1675911462498.png

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

FreemanZ
Super User
Super User

Syndicated - Outbound

hi @tomsuare 

try to create a calculated table like:
table = 
ADDCOLUMNS(
   VALUES(TableName[Employee ID]),
   CALCULATE(MAX(TableName[Company Worked]))
)
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)