March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have 4 date fields. Date Ordered, Date Shipped, Date Received, Date Created. I want to compare the dates in each field with each other to find which is the newest date then assign a field with value of the field name to show what stage the order is in. Does anyone have any ideas or a different approach? Thanks
DAte Created 7/1/2023
Date Ordered 7/3/2023
Date Shipped
Date Received
Stage = Ordered
DAte Created 7/1/2023
Date Ordered 7/3/2023
Date Shipped 7/13/2023
Date Received
Stage = Shipped
Solved! Go to Solution.
Rather than comparing dates, I just thought to look for which statuses have a value to determine the status. I'm assuming here, that the order of statuses is Create > Order > Shipped > Received.
Here's the measure I used:
Status =
var _ordered = SELECTEDVALUE('Table'[Ordered])
var _shipped = SELECTEDVALUE('Table'[Shipped])
var _received = SELECTEDVALUE('Table'[Received])
return SWITCH(TRUE(),
ISBLANK(_received) && ISBLANK(_shipped) && ISBLANK(_ordered), "Created",
ISBLANK(_received) && ISBLANK(_shipped), "Ordered",
ISBLANK(_received), "Shipped",
"Received"
)
You'll probably need to make some tweaks for it to work for your specific data though.
Is this what you are looking for?
Yes it is...thank you
Rather than comparing dates, I just thought to look for which statuses have a value to determine the status. I'm assuming here, that the order of statuses is Create > Order > Shipped > Received.
Here's the measure I used:
Status =
var _ordered = SELECTEDVALUE('Table'[Ordered])
var _shipped = SELECTEDVALUE('Table'[Shipped])
var _received = SELECTEDVALUE('Table'[Received])
return SWITCH(TRUE(),
ISBLANK(_received) && ISBLANK(_shipped) && ISBLANK(_ordered), "Created",
ISBLANK(_received) && ISBLANK(_shipped), "Ordered",
ISBLANK(_received), "Shipped",
"Received"
)
You'll probably need to make some tweaks for it to work for your specific data though.
This also worked. Thanks for the help!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |