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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kazael
Helper I
Helper I

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 5
v-cherch-msft
Employee
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

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

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
)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-cherch-msft for this awesome solution!

How should I modify it in order to add more columns in the future based on the date?

So if my original table looked like this:

ComIDUpdatedOutcomeDateOutcome
101/01/2017A
103/01/2017B
201/05/2018C
304/05/2018A
306/05/2018C
101/01/2018G
301/07/2018D
301/10/2018F

 

and I'd like to show it like this:

 

ComIDUpdatedOutcomeDate1OutcomeUpdatedOutcomeDate2OutcomeUpdatedOutcomeDate3OutcomeUpdatedOutcomeDate4Outcome
101/01/2017A03/01/2017B01/01/2018G  
201/05/2018C      
304/05/2018A06/05/2018C01/07/2018D01/10/2018F

Hi @kazael

 

It seems there is no better way to do that with DAX. Using M language in query editor is a more complex way to do that.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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