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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
EmilyM2019
Helper II
Helper II

Removing duplicates

Hello all,

 

I have a table of data recording when someone last had a performance review. My date parameters are the last rolling 12 months. Unfortunatey the review doesn't always get done on the due date and so sometimes I end up with 2 review dates taking place in the same 12 month period. For example:

 

EmilyM2019_0-1597342147736.png

I would like to remove the dulicates, making sure that the most recent PDR complete date remains.

 

Is there an easy way to do this?

 

I'm still new to Power BI so i'm not familiar with all the terminology so thank you and sorry in advance if I ask lots of follow up questions.

 

Many thanks,

 

Emily.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User
3 REPLIES 3
Icey
Community Support
Community Support

Hi @EmilyM2019 ,

 

Some workarounds for reference:

 

1. You can remove duplicate by using Group by in Power BI Query Editor.

Set it up just like the settings in the picture.

group1.gif

 

Then, create a custom column.

=let mydate = [PDR complete date] in
Table.SelectRows([All Rows],each[PDR complete date] = mydate)

group2.gif

 

Then, expand the columns you need and delete the All Rows column.

group3.png

Duplicates are removed and the most recent PDR complete date remains.

group4.png

 

2.  You can also use Group by as follows.

group5.png

 

The result is as follows.

group6.png

 

3. You can as well use Group by as follows.

group7.png

 

Then you expand the columns you need and remove the duplicates.

group8.pnggroup9.pnggroup10.png

 

4. You can try this measure which use LOOKUPVALUE function.

Measure = 
LOOKUPVALUE (
    'Table'[PDR complete date],
    'Table'[PDR complete date], CALCULATE (
        MAX ( 'Table'[PDR complete date] ),
        ALLEXCEPT ( 'Table', 'Table'[Name] )
    )
)

result2.gif

You can check more details from here.

 

 

Best Regards,

Icey

 

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

amitchandak
Super User
Super User

Thank you, really helpful.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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