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
Anonymous
Not applicable

How can I delete certain rows (or mark them as 'old information')

Dear community members, 

 

Every change in someone his Client_Healthcare_Track is communitated with a new message (Message_date). A change can be for example a new End_date or new Costs. The thing is, my dataset contains all information, even the messages that contain old information. I only need to know the message with the newest Message_date from each Client_Healthcare_Track (the bold ones). Does anyone know how I can eliminate the 'old records' or how I can mage a calculated column dat tells me if it is an old message or the latest message?

 

original dataset

Client_ID

Client_Healthcare_Track

Message_date

End_date

Costs

120684

1001

01-01-2021

31-10-2021

1000

120684

1001

15-01-2021

14-11-2021

1000

120684

1001

17-01-2021

14-11-2021

1500

120684

1001

21-01-2021

7-11-2021

1000

130783

1002

01-01-2021

31-5-2021

2500

130783

1002

07-01-2021

31-5-2021

3000

 

 How it should be... (strikethrough = old message II bold = latest message)

Client_ID

Client_Healthcare_Track

Message_date

End_date

Costs

120684

1001

01-01-2021

31-10-2021

1000

120684

1001

15-01-2021

14-11-2021

1000

120684

1001

17-01-2021

14-11-2021

1500

120684

1001

21-01-2021

7-11-2021

1000

130783

1002

01-01-2021

31-5-2021

2500

130783

1002

07-01-2021

31-5-2021

3000

 

Hope someone can help me! 

 

Best regards, Sander

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download example PBIX file

 

You can create a Calculated Column to show this

LatestMessage = IF('Table1'[Message_date] = CALCULATE(MAX('Table1'[Message_date]), FILTER('Table1', 'Table1'[Client_ID] = EARLIER([Client_ID]))), "Yes", "No")

latest.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download example PBIX file

 

You can create a Calculated Column to show this

LatestMessage = IF('Table1'[Message_date] = CALCULATE(MAX('Table1'[Message_date]), FILTER('Table1', 'Table1'[Client_ID] = EARLIER([Client_ID]))), "Yes", "No")

latest.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi @PhilipTreacy , This solution works perfect! Cheers, Sander

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.