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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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