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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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

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
v-yohua-msft
Community Support
Community Support

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".

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
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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