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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
SMatos94
New Member

Table with duplicate rows by name but different status.

Hello,

 

Table with duplicate rows by name but different status.

I have a table with duplicate rows by user name, but with different status. I need to clear the table, so that in case of duplicate rows, only the activation persists.

Does anybody know how to solve this?

 

In this example, you would need to analyze lines one and two, keeping only the one with active status.
The same for lines 4 and 5.

NameStatusSituationID
Ana SilvaActiveNormal activity1234
Ana Silva31/05/2024Transfer1234
Joao SouzaActiveNormal activity2345
Maria PaulaActiveNormal activity3456
Maria Paula07/04/2024Transfer3456
Mario Oliveira28/02/2023Company termination6789
Edson Vieira09/07/2022Company termination7894

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @SMatos94 

I made some modifications. I create a new table and use the following DAX:

FilteredTable = FILTER(
    ALL('Table'),
    [Situation] = "Normal activity" || [Situation] = "Company termination"
)

 

Here is the preview:

 vyohuamsft_0-1721352909174.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi, @SMatos94 

Create a new table that contains only the rows in which Activity is created. This will effectively remove duplicate rows that do not have a status of Active. Use the following DAX:

NewTable = 
CALCULATETABLE(
    'YourTable',
    'YourTable'[Status] = "Active"
)

 

Here is my preview:

vyohuamsft_0-1721281923908.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

The problem is that I need to know if the employee was terminated. So I can't remove the rows with status other than "Active".

Anonymous
Not applicable

Hi, @SMatos94 

I made some modifications. I create a new table and use the following DAX:

FilteredTable = FILTER(
    ALL('Table'),
    [Situation] = "Normal activity" || [Situation] = "Company termination"
)

 

Here is the preview:

 vyohuamsft_0-1721352909174.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

GilbertQ
Super User
Super User

Hi @SMatos94 

 

Equal to the status column to where it equals active.?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Yes!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors