Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a table for accounts receivables (payables by customers) that contains:
"Posting date" "Closed at date" "Due date" "Customer number" "Amount"
2021-09-01 2021-12-15 2021-12-01 ABC1 100
In the above example I would like to calculate the montly receivables so:
September = 100
October = 100
November = 100
end of December = 0
So I need to calculate a measure that states that if the date from the date table is higher than or qual to the posting date from receivables table and also closing date is higher than date from data table then show receivables amount.
I have tried with the following measure:
Solved! Go to Solution.
Hi, @Morten_DK
You can add a condition to filter Customer number in the measure.
Measure =
IF (
MAX ( 'Date'[Date] ) >= MAX ( 'Table'[Posting date] )
&& MAX ( 'Date'[Date] ) < MAX ( 'Table'[Closed at date] ),
CALCULATE (
SUM ( 'Table'[Amount] ),
FILTER (
ALL ( 'Date' ),
[Date].[Month] <= MAX ( 'Table'[Closed at date].[Month] )
),FILTER(ALL('Table'),[Customer number]=MAX('Table'[Customer number]))
),
BLANK ()
)
If the method I provided above can't solve your problem, what's your expected result? Can you provide an example diagram of your desired outcome?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Morten_DK
You can take a look at the following methods, hoping to solve your problem.
Create a new date table.
Date = CALENDAR(DATE(2021,8,1),DATE(2021,12,31))
Measure =
IF (
MAX ( 'Date'[Date] ) >= MAX ( 'Table'[Posting date] )
&& MAX ( 'Date'[Date] ) < MAX ( 'Table'[Closed at date] ),
CALCULATE (
SUM ( 'Table'[Amount] ),
FILTER (
ALL ( 'Date' ),
[Date].[Month] <= MAX ( 'Table'[Closed at date].[Month] )
)
),
BLANK ()
)
Max ('date '[date]) is the date that can be selected on the right side of the date slicer.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks!
That seems to be working on individual order numbers, but if I take an entire month without filtering on particular orders, then the sum for the month is blank. If I drill down to order numbers then I get the correct value per order, but not on month level, that is still blank.
Is there a way to force the calculation on row level and then sum up, if that is the cause of the problem in the first place?
Hi, @Morten_DK
You can add a condition to filter Customer number in the measure.
Measure =
IF (
MAX ( 'Date'[Date] ) >= MAX ( 'Table'[Posting date] )
&& MAX ( 'Date'[Date] ) < MAX ( 'Table'[Closed at date] ),
CALCULATE (
SUM ( 'Table'[Amount] ),
FILTER (
ALL ( 'Date' ),
[Date].[Month] <= MAX ( 'Table'[Closed at date].[Month] )
),FILTER(ALL('Table'),[Customer number]=MAX('Table'[Customer number]))
),
BLANK ()
)
If the method I provided above can't solve your problem, what's your expected result? Can you provide an example diagram of your desired outcome?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Morten_DK is it assumption based rule or there is data to back up this logic?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thats a logic.
When an invoice is posted (posting date) it stays in the accounts receivable until it is paid (closed at date).
The following works apart from not stopping at Closed at date:
Outstanding Invoices =
CALCULATE (
Receivables[Invoiced Receivables],
FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= MAX ( 'Date'[Date] ) )
)
if I modify it to:
Outstanding Invoices =
CALCULATE (
Receivables[Invoiced Receivables],
FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= MAX ( 'Date'[Date] ) &&'Date'[Date] <= max(Receivables[Closed_at_date]) )
)
Then I don't get all the months in between.
@Morten_DK what made December value to 0, what is the logic?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k that is because at end of december (31/12-2021) we are past "Closed at date" which means the outstanding amount has been paid, thus no outstanding anymore.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
87 | |
86 | |
68 | |
64 | |
63 |
User | Count |
---|---|
208 | |
120 | |
113 | |
79 | |
72 |