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

Calculating past late due amounts based on expected date and received date

I have a Purchase Order table that shows the date requested and the date we received it. I want to be able to go back in time and calculate the past due amounts at the end of each month. I can't find a way to attach my test pbi file so I'll put in the data here.

PO NumberRequested DateQtyUnit PriceDate received
1231/3/202332.251/3/2023
6541/8/202351.252/1/2023
1852/15/2023102.882/23/2023
3242/18/202373.53/2/2023
122333/1/2023123/4/2023
8753/15/202342.453/20/2023
4884/4/202321.635/2/2023
9884/25/202381.994/28/2023
123035/1/202360.875/15/2023

 

Example Date Table

Date Table.jpg

 

Capture1.PNG

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @russd 

Not sure if i fully get you, please try to:

1) add a calculated table lilke:

 

dates = CALENDARAUTO()

 

Note: don't join the tables.

2) plot a visual with the dates[date] column and a measure like:

 

due amount = 
VAR _date = MAX(dates[date])
RETURN
SUMX(
    FILTER(
        data,
        data[Requested Date]<=_date
            &&data[Date Received]>=_date
    ),
    data[Qty]*data[Unit Price]
)+0

 

it worked like:

FreemanZ_0-1683944290692.png

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

hi @russd 

Not sure if i fully get you, please try to:

1) add a calculated table lilke:

 

dates = CALENDARAUTO()

 

Note: don't join the tables.

2) plot a visual with the dates[date] column and a measure like:

 

due amount = 
VAR _date = MAX(dates[date])
RETURN
SUMX(
    FILTER(
        data,
        data[Requested Date]<=_date
            &&data[Date Received]>=_date
    ),
    data[Qty]*data[Unit Price]
)+0

 

it worked like:

FreemanZ_0-1683944290692.png

Ajendra
Resolver I
Resolver I

Hey,

 

1) First of all add calculated column in your data.

1.JPG

 

2) Then try this measure.

2.JPG

Thank you for your reply. This does not give me the output I requested. I'm in the month of May 2023, my fact table updates daily. I want to be able to see what my late total was back in Jan 2023 based on the date I expected my Purchase Orders to arrive and the date that I received them. 

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.

Top Solution Authors