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
Hawjeen
Frequent Visitor

Show only latest version

Hi,

 

I came across an issue i cant solve myself, and hope maybe someone ot there could help me.

 

My data looks like the below, i want to somehow only show the latest version for a document and all the lines connected with that.

e.g row 10-23 should not be visible because row 24-30 is the same document but with a latere version.

 

RowDocument No_Version No_Line No_Show
1SO0222092110000Yes
2SO0222096110000Yes
3SO0222096120000Yes
4SO0222101110000Yes
5SO0222101120000Yes
6SO0222114110000Yes
7SO0222114120000Yes
8SO0222121110000Yes
9SO0222121120000Yes
10SO0222129110000No
11SO0222129120000No
12SO0222129130000No
13SO0222129140000No
14SO0222129150000No
15SO0222129160000No
16SO0222129170000No
17SO0222129210000No
18SO0222129220000No
19SO0222129230000No
20SO0222129240000No
21SO0222129250000No
22SO0222129260000No
23SO0222129270000No
24SO0222129310000Yes
25SO0222129320000Yes
26SO0222129330000Yes
27SO0222129340000Yes
28SO0222129350000Yes
29SO0222129360000Yes
30SO0222129370000Yes
31SO0222141110000No
32SO0222141210000No
33SO0222141310000No
34SO0222141410000No
35SO0222141510000No
36SO0222141610000No
37SO0222141710000No
38SO0222141810000Yes
39SO0222165110000Yes
40SO0222187110000Yes
41SO0222187120000Yes

 

I would like to do it through powerquery if possible, my current query is quite simple:

 

 

 

 

let
Kilde = Sql.Database("xxx.com", "xxx"),
#"xxx$Sales Line Archive" = Kilde{[Schema="dbo",Item="xxx$Sales Line Archive"]}[Data],
#"Filtrerede rækker" = Table.SelectRows(#"xxx$Sales Line Archive", each ([Shipment Date] = #datetime(2020, 10, 2, 0, 0, 0)) and ([Shortcut Dimension 1 Code] = "2220"))
in
#"Filtrerede rækker"

 

 

 

 

Hope someone could help me out 🙂

 

Regards Hawjeen

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Use a 'Group By' on Document No.

2 Aggregations : Max  of Version No,   and   all rows

 

 

Expand the new column, then using Table.SelectRows    filter only the rows where  MaxVersionNo = the version no from original data.

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

Use a 'Group By' on Document No.

2 Aggregations : Max  of Version No,   and   all rows

 

 

Expand the new column, then using Table.SelectRows    filter only the rows where  MaxVersionNo = the version no from original data.

Thank you - so simple but i simply couldnt come up with that soloution myself

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