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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Oskar
Frequent Visitor

Sort table on last - shows wrong result

I have a table that looks like this

 

Status (TEXT)Date (Date and Time)Customer (TEXT)
Active2024-05-17 11:30:49Customer A
Inactive2024-05-17 09:27:12

Customer A

 

In powerbi i want to create a table that display my rows.

This works.

 

Then i want to filter on last status

Oskar_0-1717535189604.png

 

It works but it mixes things up.

If i select Last.

Then the powerbi table looks like this:

Status (TEXT)Date (Date and Time)Customer (TEXT)
Inactive2024-05-17 11:30:49

Customer A

 

I dont understand why it now shows the date connected to the wrong status....

Its like the date and time column is not working.....

 

 

any tips on how to fix this?

 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

It's because it's displaying the "Last" value alphabetically, rather than by the status time. You need to use a measure in this case to grab the latest status (and customer too!) The reason the date works is because it is technically stored as a number - so it makes sense to grab the biggest number in the series of dates.

 

Here's the measure i used to grab the latest status - you can easily modify to grab the latest customer:

Latest Status = CALCULATE(MAX('Table (2)'[Status (TEXT)]), 'Table (2)'[Date (Date and Time)] = MAX('Table (2)'[Date (Date and Time)]))

View solution in original post

1 REPLY 1
vicky_
Super User
Super User

It's because it's displaying the "Last" value alphabetically, rather than by the status time. You need to use a measure in this case to grab the latest status (and customer too!) The reason the date works is because it is technically stored as a number - so it makes sense to grab the biggest number in the series of dates.

 

Here's the measure i used to grab the latest status - you can easily modify to grab the latest customer:

Latest Status = CALCULATE(MAX('Table (2)'[Status (TEXT)]), 'Table (2)'[Date (Date and Time)] = MAX('Table (2)'[Date (Date and Time)]))

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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