Forum Discussion

ThomasWeppler's avatar
ThomasWeppler
Impactful Individual
4 years ago

Sorte after date and time

Hi power bi community

I have a table with diffrent assingments called [assignment]. Each assignment have its own todoid.
Each assignment all have a diffrent title based on where in the process they are. You can find this data in another table called [todotitlehistory] It looks like this.

This table is connected to the other assignment by the todoid.
In my repport I want to have a table which show the assingments todoid, but it also need to show the latest title.
So if we look at the assingment with todoid 1076 it should show planned from 28/02/2022 until 27/05/2022
It should show Aktiv from 20/05/2022 until 08/06/2022
And from 09/06/2022 and forward it should show closed.

In this example a mistake happended and someone set the title to planned 09/06/2022 but changed it to closed 30 sekunds later.
If someone changes an assingments title multiple times in a day it should show the last.

I hope this make sense and any help will be greatly appreciated

1 Reply

  • ThomasWeppler's avatar
    ThomasWeppler
    Impactful Individual

    I have found a solution. If a moderator see this you can just close it.

    The table also had an index colum. And the higher number was always added at a later time, so I just wrote this.

     

    Status =
    var _maxid = MAX(Todostatehistory[index])
    return
    LOOKUPVALUE(Todostatehistory[title], Todostatehistory[index], _maxid)

    And it solved the problem