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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.