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
pawelj795
Post Prodigy
Post Prodigy

Mark rows with the latest value

Hi,
I have a data table like below.

 

pawelj795_1-1617024980419.png
Now, I want to mark rows, which meet these conditions:

  • They contains duplicate values in both columns at the same time: parent_product_tmpl_id, product_tmpl_id
    (in my screenshot it will be ID: 290256, 153653)
  • Next, for rows, which meet the above condition, select the row with the latest date in a column create_date
    (in my screenshot it will be ID: 290256)
  • Furthermore, these marks must be created in a column, not a measure


Sample file:

https://drive.google.com/file/d/1JRVwaAN-WDW0xzo-WEAu9vUZM7yygyCW/view?usp=sharing

 

If something is not clear for you, please ask and I kindly respond.

Thanks in advance!

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @pawelj795 ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1617246549558.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

7 REPLIES 7
v-lionel-msft
Community Support
Community Support

Hi @pawelj795 ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1617246549558.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

ryan_mayu
Super User
Super User

@pawelj795 

please check the attachment to see if this is what you want





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu 
@amitchandak 

Sorry, but both of your answers are not working properly.

My goal is to filter out rows that meet all of these conditions.
In your answers, it works fine for duplicates but simultaneously it filters out also some rows with distinct values.
This column must work for the whole data table.

Moreover, the answer must be created in one column, not divided by 2 columns.

.

amitchandak
Super User
Super User

@pawelj795 , You can create a new column like

 

New column =
var _max = maxx(filter(Table, [parent_product_tmpl_id] = earlier([parent_product_tmpl_id]) && [product_tmpl_id] = earlier([product_tmpl_id])),[create_date])
return
if([create_date] =_max , 1, 0)

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak 
Thanks for your response.
Unfortunately, your column doesn't work.

pawelj795_0-1617027287781.png


My main goal is to filter out rows, which are duplicates with the earliest values, however I want to keep the other rows, which don't meet the first condition

 

@pawelj795 , try Id in place of date

 

New column =
var _max = maxx(filter(Table, [parent_product_tmpl_id] = earlier([parent_product_tmpl_id]) && [product_tmpl_id] = earlier([product_tmpl_id])),[ID])
return
if([ID] =_max , 1, 0)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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.