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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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