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
Luzadriana255
Helper II
Helper II

Find the status missing amount a line of status for different requests

Hello, 

I have a 5 STEP process for different REQUESTS (A, B and C in the table). The process should be completed in the step order from 1 to 5. Every step have a STATUS NAME and a ACHIEVED STATUS column. The achieve status column should contain all the status of the steps before. I need to identify which steps where jump by returning the name of the status that are missing on the achieved status column. Request A shows the ideal case where all the status were achieved, and B and C show example of request that were missing some status in some steps. Do you have an idea on how to solve this? Thank you for your help!

 

 

Request

Step

Status Name

Achieved Status

Missing

A

1

RE

 

 

A

2

BA

RE

 

A

3

ST

RE, BA

 

A

4

WE

RE, BA,ST

 

A

5

PI

RE, BA,ST,WE

 

B

1

RE

 

 

B

2

BA

RE

 

B

3

ST

RE

BA

B

4

WE

RE, ST

BA

B

5

PI

RE, ST

BA,WE

A

1

RE

 

 

A

2

BA

RE

 

A

3

ST

RE, BA

 

A

4

WE

RE, BA

ST

A

5

PI

RE, BA,WE

ST

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Luzadriana255 

If you want to do this using DAX then add the following Column to your table. I am not sure how big is your data table to know the performance of this DAX, please update me once you try.

Missing Step = 
VAR __REQ = [Request] 
VAR __STEP = [Step]
VAR __ACH = [Achieved Status]
VAR __MISSING = 
    CONCATENATEX(
        CALCULATETABLE(
            VALUES(Table1[Status Name]),
            Table1[Request] = __REQ,
            Table1[Step] < __STEP,
            REMOVEFILTERS('Table1')
        ),
        VAR __STATUS = Table1[Status Name] 
        VAR __EXISTS = NOT(CONTAINSSTRING(__ACH , __STATUS))
        RETURN
        IF( __EXISTS, __STATUS & ", ")
    )
VAR __RESULT = 
    IF( LEN(__MISSING) > 0 ,  LEFT(__MISSING,LEN(__MISSING)-2))
RETURN
    __RESULT

Fowmy_0-1678027218297.png

File is attached 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
Luzadriana255
Helper II
Helper II

@Fowmy I divided the fomula into two columns and it works now. Thank you so much for your help!

Luzadriana255
Helper II
Helper II

Hi @Fowmy 

thank you so much for your Help. Your formula is great and it works perfectly in my test Data. However, it seems that my original data contains a lot of Information and I got the following Message: "there is not enough memory available for this operation. Try again later when more memory may be available"

Do you know what can be done in this case? 

Thank you so much!

Thank you

Fowmy
Super User
Super User

@Luzadriana255 

If you want to do this using DAX then add the following Column to your table. I am not sure how big is your data table to know the performance of this DAX, please update me once you try.

Missing Step = 
VAR __REQ = [Request] 
VAR __STEP = [Step]
VAR __ACH = [Achieved Status]
VAR __MISSING = 
    CONCATENATEX(
        CALCULATETABLE(
            VALUES(Table1[Status Name]),
            Table1[Request] = __REQ,
            Table1[Step] < __STEP,
            REMOVEFILTERS('Table1')
        ),
        VAR __STATUS = Table1[Status Name] 
        VAR __EXISTS = NOT(CONTAINSSTRING(__ACH , __STATUS))
        RETURN
        IF( __EXISTS, __STATUS & ", ")
    )
VAR __RESULT = 
    IF( LEN(__MISSING) > 0 ,  LEFT(__MISSING,LEN(__MISSING)-2))
RETURN
    __RESULT

Fowmy_0-1678027218297.png

File is attached 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Luzadriana255 

How many rows do you have in your table? 
I will also try a Power Query approach if it works for you.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy I have 102960 rows. It will be great if you have an Idea on how to implement this in Power Query. Thank you!

 

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.

Top Solution Authors