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
CProco
New Member

Find the Next Date a Transaction will need to Happen

I have a calculated table that shows a list of customers and every time we are scheduled to send money to them (each customer gets a schedule when they bocome our customer and they can get money up to 7 times, but they dont have to take any money so a lot of scheduled dates are 1/1/1900)

 

What I need to find is the next date we need to send each customer money based on there actually being a scheudle funding for the customer (draw_1_scheduled) and that money hasnt already been sent (draw_1_funded)

 

customer_IDdraw_scheduleddraw_funded
11/1/19001/1/1900
25/16/20211/1/1900
31/1/19001/1/1900
45/1/20211/1/1900
11/1/19001/1/1900
26/16/20211/1/1900
31/1/19001/1/1900
45/16/20211/1/1900
11/1/19001/1/1900
27/16/20211/1/1900
31/1/19001/1/1900
46/1/20211/1/1900
11/1/19001/1/1900
28/16/20211/1/1900
31/1/19001/1/1900
46/16/20211/1/1900
11/1/19001/1/1900
21/1/19001/1/1900
31/1/19001/1/1900
47/1/20211/1/1900
11/1/19001/1/1900
21/1/19001/1/1900
31/1/19001/1/1900
47/16/20211/1/1900
11/1/19001/1/1900
21/1/19001/1/1900
31/1/19001/1/1900
41/1/19001/1/1900
1 ACCEPTED SOLUTION

Hi @CProco

 

You can try this:

Measure = 
CALCULATE(
    MIN('Table'[draw_scheduled]),
    FILTER(
        ALL('Table'),
        'Table'[customer_ID]=MAX('Table'[customer_ID]) && 'Table'[draw_funded]=MINX('Table','Table'[draw_funded]) && 'Table'[draw_scheduled]<>MINX('Table','Table'[draw_scheduled])
    )
)

 

Best Regards,
Link

 

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

3 REPLIES 3
v-xulin-mstf
Community Support
Community Support

Hi @CProco

 

You can try measure as:

Measure = 
CALCULATE(
    MIN('Table'[draw_scheduled]),
    FILTER(
        ALL('Table'),
        'Table'[customer_ID]=MAX('Table'[customer_ID]) &&'Table'[draw_scheduled]>TODAY()
    )
)

 Here is the output:

v-xulin-mstf_0-1621404953262.png

The pbix is attached.

 

Best Regards,
Link

 

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

Thank you for responding! This was about where I was able to get it. The only problem is that the results for 2 should be 5/16/2021 and for 4 should be 5/1/2021 since they are the oldest on the schedule that havent funded per draw_funded

Hi @CProco

 

You can try this:

Measure = 
CALCULATE(
    MIN('Table'[draw_scheduled]),
    FILTER(
        ALL('Table'),
        'Table'[customer_ID]=MAX('Table'[customer_ID]) && 'Table'[draw_funded]=MINX('Table','Table'[draw_funded]) && 'Table'[draw_scheduled]<>MINX('Table','Table'[draw_scheduled])
    )
)

 

Best Regards,
Link

 

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

 

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.