Forum Discussion

Ssmit's avatar
Ssmit
Frequent Visitor
8 years ago
Solved

Creating a new table based on multiple factors

Greetings,

I'm still quite new to PowerBI and I've had the luck of pretty much finding information about everything I needed.

However; my issue is as follows:

I need to create a new table based on multiple factors.

First being I need to select the earliest possible ticket based on the earliest action date/time(activityTime) that is known.
Second I need to filter the above by checking if the timeDifference is bigger than the priorityTime and only display the tickets that meet both of the above factors.

companyNametitleticketNumbercTimeactivityTimepriorityLevelpriorityTimeuserFullnamestatusNiveautypeIdLeveltimeDifference
           
xtest1017-04-2018 09:23:3918-04-2018 09:04:15Low24:00:00xOpenMalfunction08:40
xtest916-04-2018 16:12:3116-04-2018 17:02:29Low24:00:00xOpenMalfunction00:49
xtest820-02-2018 14:28:3320-02-2018 14:44:07Low24:00:00xActiveMalfunction00:15
xtest820-02-2018 14:28:3320-02-2018 15:12:22Low24:00:00xActiveMalfunction00:43
xtest820-02-2018 14:28:3320-02-2018 15:58:13Low24:00:00xActiveMalfunction01:29
xtest820-02-2018 14:28:3321-02-2018 10:05:54Low24:00:00xActiveMalfunction04:37
xtest714-02-2018 13:32:2921-02-2018 13:41:36Average08:00:00xActiveMalfunction46:09
xtest714-02-2018 13:32:2921-02-2018 16:28:56Average08:00:00xActiveMalfunction75:56
xtest607-03-2017 09:28:2807-03-2017 11:32:00High02:00:00xActiveMalfunction02:04
xtest607-03-2017 09:28:2807-03-2017 14:24:31High02:00:00xActiveMalfunction04:56
xtest528-09-2016 17:17:4018-04-2018 09:04:15Low24:00:00xActiveMalfunction2546:55
xtest528-09-2016 17:17:4018-04-2018 09:10:15Low24:00:00xActiveMalfunction2556:55
xtest428-12-2015 15:23:4318-04-2018 09:04:15Average08:00:00xActiveMalfunction5285:40
xtest428-12-2015 15:23:4318-04-2018 09:10:15Average08:00:00xActiveMalfunction5291:40
xtest323-11-2015 09:15:0023-11-2015 09:15:00Urgent01:00:00xOpenMalfunction00:00
xtest222-11-2015 08:30:0022-11-2015 10:30:00Urgent01:00:00xOpenMalfunction02:00
xtest121-11-2015 09:30:0021-11-2015 10:30:00High02:00:00xActiveMalfunction01:00

 

What is shown above is the current test data and what is shown below is what the new table should look like based on the two factors but I have absolutely no clue where to start with this

 

xtest714-02-2018 13:32:2921-02-2018 13:41:36Average08:00:00xActiveMalfunction46:09
xtest607-03-2017 09:28:2807-03-2017 11:32:00High02:00:00xActiveMalfunction02:04
xtest528-09-2016 17:17:4018-04-2018 09:04:15Low24:00:00xActiveMalfunction2546:55
xtest428-12-2015 15:23:4318-04-2018 09:04:15Average08:00:00xActiveMalfunction5285:40
xtest222-11-2015 08:30:0022-11-2015 10:30:00Urgent01:00:00xOpenMalfunction02:00

 

A massive thank you to whomever is able to help, even if it's just a little bit!

4 Replies

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    Hi Ssmit,

     

    Try DAX formula below:

    new table =
    FILTER (
        table,
        table[activityTime] = MIN ( table[activityTime] )
            && tabel[timeDifference] > table[priorityTime]
    )

     

    Regards,

    Jimmy Tao

    • Ssmit's avatar
      Ssmit
      Frequent Visitor

      Hello Jimmy,

       

      Unfortunately this returns an empty table.

      I think the reason for this is the way I put together the priorityTime and TimeDifference.

      Both are in text format because I wanted both of them to show the full time value instead of starting over when the time goes past 23:59. I'm using CONCATENATE and TRUNC to piece them together.

      • Ssmit's avatar
        Ssmit
        Frequent Visitor

        Decided to keep playing around with it for a bit after I was done with some other stuff I had to do today.

         

        timeDifference > priorityTime works just fine, I'm guessing that the other part of the filter Jimmy suggested somehow didn't get picked up when making the new table