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
grell
Employee
Employee

Removing earlier versions of a each TFS Work Item from the Power Query

I am working with TFS warehouse data, and am a novice in T-SQL. I need to utilize Work Item data and have a power query mostly done, but don't know how to eliminate all the earlier versions of each entry, that are appearing in the query. Has anyone solved this problem on the Power BI side of the fence? If no, on the SQL side?

1 REPLY 1
mike_honey
Memorable Member
Memorable Member

I would usually build another Query which identifies the rows you want to keep, e.g. use a Group By with Max of some date/time field (e.g. Last Modified Date - I'm not familiar with the TFS schema).  Then you can Merge your first Query with the Group By query, using Join Kind = Inner to filter the rows.

 

You can build the Queries using "Reference" to avoid duplicating code - typically for this scenario you start with a "Base" query, the a "Group By" query, started by "Reference" to the "Base" query. Finally you add an "Output" query, also started by "Reference" to the "Base" query, with the Merge step to the "Group By" query.  The first 2 queries would be hidden from users.

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.

Top Solution Authors
Top Kudoed Authors