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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.