Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AmitSaini
Frequent Visitor

Need to build new table who have unique filtered data rows only from existing table

Hi Community Members,

Need your help to build new table from the existing table. below is the table look like.

AmitSaini_0-1736418360556.png

As you seen in the above table, we have some duplicate id's with different status and auto_status.

I want to create new table using the above table , if we have any duplicate id then we consider only id who have the status= Yes and Auto_Status = Candidate for Automation only.

Taking example for 1st id - 1047452, need to keep only second row only because who have the status= Yes and Auto_Status = Candidate for Automation, first row should remove. 

And my result table or final table look like below:- 

AmitSaini_1-1736418685661.png

 

Please help me to achieve this in Power query or Dax.

 

Thanks

3 REPLIES 3
v-fenling-msft
Community Support
Community Support

Thanks for bhanu_gautam's concern about this issue.

 
Hi, @AmitSaini 

I am glad to help you.

 

Perhaps you could try using the following DAX:

NewTable = 
UNION (
    FILTER (
        ExistingTable,
        ExistingTable[status] = "Yes" && ExistingTable[Auto_Status] = "Candidate for Automation"
    ),
    FILTER (
        ExistingTable,
        COUNTROWS (
            FILTER (
                ExistingTable,
                ExistingTable[ID] = EARLIER(ExistingTable[ID])
            )
        ) = 1
    )
)

 

Output:

vfenlingmsft_0-1736477455591.png

 

I have attached the pbix file for this example below, I hope it helps!

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bhanu_gautam
Super User
Super User

@AmitSaini , Create a new table using DAX

NewTable =
FILTER (
ExistingTable,
ExistingTable[status] = "Yes" && ExistingTable[Auto_Status] = "Candidate for Automation"
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






hi @bhanu_gautam 

Thanks for your reply.

But it won't work. The dax table you suggested it gives us only the id who have status] = "Yes" and [Auto_Status] = "Candidate for Automation" and exclude others rows who have unique rows entry.

for e.g. id 1188065,1188055 and all rows from project Kodiak.

Please see my Expected table output screenshot. I need unique rows entry as well.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.