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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Greg5
Frequent Visitor

Approval Date less than the Order Date (two Tables)

Hello,

I'm creating an SLA indicator for this, I need to do this formula below.

I have two tables, one containing the order number, order creation date and request number that originated the order, the other has the approval date of the requests that some have a re-approval date after the creation date of the request.

I need to bring to the order table, the approval date that is the last approval date before the order creation date.

RC - APPROVAL DATE
1 10/12/2022
2 10/07/2022

RC - APPROVAL DATE
1 10/08/2022
1 10/14/2022
2 10/05/2022
2 10/06/2022
2 10/10/2022

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Greg5 ,

According to your description, seems you messed up the data. I create a sample.

Order table:

vkalyjmsft_0-1667383439111.png

Approval table:

vkalyjmsft_1-1667383450321.png

Here's my solution. Create a calculated column in Order table:

Column =
MAXX (
    FILTER (
        'Approval',
        'Approval'[Request num] = EARLIER ( 'Order'[request number] )
            && 'Approval'[APPROVAL DATE] <= EARLIER ( 'Order'[order creation date] )
    ),
    'Approval'[APPROVAL DATE]
)

Get the correct result:

vkalyjmsft_2-1667383527013.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @Greg5 ,

According to your description, seems you messed up the data. I create a sample.

Order table:

vkalyjmsft_0-1667383439111.png

Approval table:

vkalyjmsft_1-1667383450321.png

Here's my solution. Create a calculated column in Order table:

Column =
MAXX (
    FILTER (
        'Approval',
        'Approval'[Request num] = EARLIER ( 'Order'[request number] )
            && 'Approval'[APPROVAL DATE] <= EARLIER ( 'Order'[order creation date] )
    ),
    'Approval'[APPROVAL DATE]
)

Get the correct result:

vkalyjmsft_2-1667383527013.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ryan_mayu
Super User
Super User

you provided two sample data of approval table. What's the sample data in another table?

What's the expected output?





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

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.