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
Anonymous
Not applicable

How to combine the different status transitions using DAX by ID?

Hi all,

 

Last time I have asked the following question: https://community.powerbi.com/t5/Desktop/How-to-determine-the-different-transitions-of-statuses-usin...

Now I want to have al the different transitions combined by ID.

 

See below my test dataset:

 

ID  Status  Index
A1  OX  1
A1  LX  2
A1  KX  3
A1  OX  4
A2  OX  5
A2  KX  6
A2  LX  7
A2  OX  8 

 

The output should be as followed:

ID  Transitions  
A1  OX-LX-KX-OX   
A2  OX-KX-LX-OX  

 

To determine the different transitions I have used the following code:

Column = 
VAR ind = 'Table'[Index] + 1
VAR next =
    CALCULATE (
        MAX ( 'Table'[Status] ),
        FILTER (
            'Table',
            'Table'[ID] = EARLIER ( 'Table'[ID] )
                && 'Table'[Index] = ind
        )
    )
RETURN
    IF ( ISBLANK ( next ), BLANK (), 'Table'[Status] & "-" & next )

Does someone have some tips and tricks for me to produce the output?

 

Thanks!

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@Anonymous  Please try this !

 

Test = CONCATENATEX(FILTER(Test04,Test04[ID]=EARLIER(Test04[ID])),Test04[Status],"-",Test04[Index])

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@Anonymous  Please try this !

 

Test = CONCATENATEX(FILTER(Test04,Test04[ID]=EARLIER(Test04[ID])),Test04[Status],"-",Test04[Index])

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Hey, 

 

I need to do something similar except to also remove duplicates. Ie imagine for ID A1 there were two "OX" statuses. Could you help me out? Thanks!

Anonymous
Not applicable

Thanks, this works!

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.