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
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
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.