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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Delete duplicates in directquery

Hey Community, 

So i'm using directquery mode And I need to delete rows that are (almost) identical, keeping the last row. Example below:

 

Source:

ID, Type , Type2,

1, A, a

1, A, b

1, B, a

 

Result:

1, A, b

1, B, a

 

So I delete One of the first two rows because ID And Type Are equal.

 

Any ideas How to get this Done? 

1 ACCEPTED SOLUTION
v-xiaoyan-msft
Community Support
Community Support

Hi,@Anonymous 

You can use a measure as visual level filter to meet your needs:

 

 

Create a measure like this after you got the sample:

Measure = RANKX(ALLEXCEPT('Table','Table'[ID],'Table'[Type]),CALCULATE(MAX('Table'[Type2])),,DESC)

2020-12-22.png

 

 

Then you can put the measure in your visual to filter what you want.

 

Screenshot 2020-12-22 143253.png

Hope it helps.

 

Best Regards,

Caitlyn Yan

 

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

2 REPLIES 2
v-xiaoyan-msft
Community Support
Community Support

Hi,@Anonymous 

You can use a measure as visual level filter to meet your needs:

 

 

Create a measure like this after you got the sample:

Measure = RANKX(ALLEXCEPT('Table','Table'[ID],'Table'[Type]),CALCULATE(MAX('Table'[Type2])),,DESC)

2020-12-22.png

 

 

Then you can put the measure in your visual to filter what you want.

 

Screenshot 2020-12-22 143253.png

Hope it helps.

 

Best Regards,

Caitlyn Yan

 

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

@Anonymous , You can delete data in Direct Query. In Visual Take max of Type2 and other two as not summarized

 

measure = Max(Table[Type2])

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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