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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Kylli
Regular Visitor

Selecting rows in Power Query

Date                      Code       Name             Price    Partner

26.07.20211819NAPA14,5Firma
06.06.20221819NAPA15,2Firma

 

If there are two different prices in the table, I want to keep only the row with the later date.

2 ACCEPTED SOLUTIONS
KT_Bsmart2gethe
Impactful Individual
Impactful Individual

Hi @Kylli,

 

Step1:

GroupBy

KT_Bsmart2gethe_2-1662415086900.png

 

 

Step2:

Replace highlighted code with Table.Max(_,"Date")

 

KT_Bsmart2gethe_3-1662415129229.png

KT_Bsmart2gethe_4-1662415173094.png

 

Step3:

Expand column

KT_Bsmart2gethe_5-1662415236522.png

KT_Bsmart2gethe_6-1662415284324.png

 

 

Regads

KT

 

View solution in original post

4 REPLIES 4
KT_Bsmart2gethe
Impactful Individual
Impactful Individual

Hi @Kylli,

 

Step1:

GroupBy

KT_Bsmart2gethe_2-1662415086900.png

 

 

Step2:

Replace highlighted code with Table.Max(_,"Date")

 

KT_Bsmart2gethe_3-1662415129229.png

KT_Bsmart2gethe_4-1662415173094.png

 

Step3:

Expand column

KT_Bsmart2gethe_5-1662415236522.png

KT_Bsmart2gethe_6-1662415284324.png

 

 

Regads

KT

 

CARL12345
Regular Visitor

Hey kylli, 

 

sort the the colum date in descending oder. 

Write before the formula which ist used For sorting the colums: Table.Buffer

 

The Formula should Look Like this: 

=Table.Buffer(Table.Sort())

In the second step you can select colum date and colum article and remove  duplicated rows.

Hi,

 

Sorry, I didn't make my question clear.

 

There are many rows in the table. Most have one price per code.

Sometimes there are two or more prices per code.

If there are more prices, the latest in terms of date should be taken into account.

 

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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

Top Solution Authors