Forum Discussion

kazael's avatar
kazael
Helper I
7 years ago

Show ticket progress status

Hi PBI community!

I am trying to show service ticket status progress or change over time on a PBI report.

I have a normalized table that looks like this:

ComIDUpdatedOutcomeDateOutcome
101/01/2017A
103/01/2017B
201/05/2018C
304/05/2018A
306/05/2018C

So every new status will be added in a new row.

 

In order to show the most recent status/outcome, I created two calculated columns:

ComIDUpdatedOutcomeDateOutcomeMaxDateIsLatest
101/01/2017A03/01/2017Older
103/01/2017B03/01/2017Latest
201/05/2018C01/05/2018Latest
304/05/2018A06/05/2018Older
306/05/2018C06/05/2018Latest

using these DAX expressions:

MaxDate = CALCULATE(MAX(Com_OutcomeTbl[OutcomeDate]),FILTER(Com_OutcomeTbl,Com_OutcomeTbl[ComID]=EARLIER(Com_OutcomeTbl[ComID])))
IsLatest = IF(Com_OutcomeTbl[OutcomeDate]=Com_OutcomeTbl[MaxDate],"Latest","Older")

What I'd like to do next is to present how the outcome changes over time. I was thinking about presenting it with the Sankey visual but essentially I want it to look like this:

Count ComIDFirst StatusCount ComIDSecond Status
5A3B
  2C
2B2B
7C1B
  6C

 

 

My main challenge is how to reorganize the data to fit this use.

Thanks for the help!

5 Replies

  • v-cherch-msft's avatar
    v-cherch-msft
    Microsoft Employee

    Hi kazael

     

    Could you expain more about your expected output? I cannot fully understand the third table. How do the First Status and Second Status and Count ComID come from ?

     

    Regards,

    Cherie

    • kazael's avatar
      kazael
      Helper I

      Hi v-cherch-msft

      Sorry, you're right. It wasn't very clear.

      I'm looking for a way to pivot the first table based on the date, so it will look like that:

       

       

      ComIDUpdatedOutcomeDate1OutcomeUpdatedOutcomeDate2Outcome
      101/01/2017A03/01/2017B
      201/05/2018C  
      304/05/2018A06/05/2018C

       

      In addition, I'd like to add columns dynamically in case there are other outcomes and dates added to the same ComID.

       

      Is it possible with DAX? Would it be better to push it to the DB and write it with SQL?

       

      Thank you!

      • v-cherch-msft's avatar
        v-cherch-msft
        Microsoft Employee

        Hi kazael

         

        It seems you may try to add measures for the table as below:

        UpdatedOutcomeDate2 =
        IF (
            MAX ( Com_OutcomeTbl[OutcomeDate] )
                = CALCULATE (
                    MAX ( Com_OutcomeTbl[OutcomeDate] ),
                    ALLEXCEPT ( Com_OutcomeTbl, Com_OutcomeTbl[ComID] )
                ),
            MAX ( Com_OutcomeTbl[OutcomeDate] )
        )
        Outcome2 =
        CALCULATE (
        MAX ( Com_OutcomeTbl[Outcome] ),
        ALLEXCEPT ( Com_OutcomeTbl, Com_OutcomeTbl[ComID] )
        )

        Add a filter measure as below and drag it to visual level filter.

        Filter =
        IF (
            MAX ( Com_OutcomeTbl[OutcomeDate] )
                = CALCULATE (
                    MIN ( Com_OutcomeTbl[OutcomeDate] ),
                    ALLEXCEPT ( Com_OutcomeTbl, Com_OutcomeTbl[ComID] )
                ),
            1
        )

         

        Regards,

        Cherie