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
king2005r
Helper III
Helper III

Check the previous column value, with default status

Hi Everyone, 

 

I need your help, I have very sample request

 

I want the formula to check if there any previous "active" orders for the same customer ID that has "Active" status so the final output will be "Not yet" status regardless of any other status

 

Data does not include any date. 

 

Example :

 

Customer IDOrder NumberCustomer nameStatus
114456JohanActive
114876JohanClosed
211222Test1Active
211484Test1Close
211454Test1Close
317461SarahClose

 

Output : 

Customer IDOrder NumberCustomer nameStatusAll customer package deliver
114456JohanActiveNot yet
114876JohanClosedNot yet
211222Test1ActiveNot yet
211484Test1CloseNot yet
211454Test1CloseNot yet
317461SarahCloseYes

 

 

1 ACCEPTED SOLUTION

Picture1.png

 

All customers package deliver CC =
IF (
"Active"
IN SUMMARIZE (
FILTER ( Data, Data[Customer ID] = EARLIER ( Data[Customer ID] ) ),
Data[Status]
),
"Not yet",
"Yes"
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

5 REPLIES 5
tamerj1
Super User
Super User

Hi @king2005r 

You can use the following for a calculated column 

All Customer Package Delivered =
IF (
    COUNTROWS (
        FILTER (
            Data,
            Data[Customer ID] = EARLIER ( Data[Customer ID] )
                && Data[Status] = "Active"
        )
    ) > 0,
    "Not yet",
    "Yes"
)
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a calculated measure.

 

Picture1.png

 

All customers package deliver: =
IF (
HASONEVALUE ( Data[Customer ID] ),
IF (
"Active"
IN CALCULATETABLE (
VALUES ( Data[Status] ),
ALLEXCEPT ( Data, Data[Customer ID] )
),
"Not yet",
"Yes"
)
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi 

Thank you for your reply, the attached solution is measurement, can I have it as a column? 

Picture1.png

 

All customers package deliver CC =
IF (
"Active"
IN SUMMARIZE (
FILTER ( Data, Data[Customer ID] = EARLIER ( Data[Customer ID] ) ),
Data[Status]
),
"Not yet",
"Yes"
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you so much, this is work fine 🙂 appreciated! 

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.