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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
deniseg
Regular Visitor

Debtors Days DAX Calculation

Dear PowerBi Community,

 

I would like to ask for your help to calculate on DAX the Debtors Days.

 

Debtor Days = (Average Receivables in a Period) / (Revenue of current month * Number of Days in the Period.

 

Used the below three DAX Formulas but I still did not get the correct Debtors Days.

 

First, I calculated the Average Receivables,

 

Average Receivables = CALCULATE(AVERAGE('AR v AP Database'[Amount]),
DATESINPERIOD('Month Year Date'[Date],LASTDATE('Month Year Date'[Date]),-2,MONTH), FILTER('AR v AP Database','AR v AP Database'[AR v AP] = "AR"))
 
and then the Revenue of the Current Period multiply by 30 days,
 
Revenue of Current Period = [Actual Financial Total Revenue] * 30
 
lastly the Debtors Days
 
Debtors Days = [Average Receivables] / [Revenue of Current Period]
 

I think there is a mistake on my Average Receivable Days DAX Formula.

 

I hope you can help me.

 

Thank you,

 

Denise G

 

1 ACCEPTED SOLUTION

Hi @deniseg ,

 

'Month Year Date'[Date] is the date column of a marked date table. And Try the following formula:

 

Average Receivables = 
CALCULATE(
    AVERAGE('AR v AP Database'[Amount]),
    DATESINPERIOD( 'Month Year Date'[Date], LASTDATE('AR v AP Database'[Date]), -2, MONTH ), 
    FILTER(
        ALL('AR v AP Database'),
        'AR v AP Database'[AR v AP] = "AR"
    ),
    GROUPBY('AR v AP Database','AR v AP Database'[AR v AP])
)

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

4 REPLIES 4
daxer-almighty
Solution Sage
Solution Sage

a / b * c is not equal to a / (b * c). Your formula is syntactically invalid on top of that...

 

Debtor Days = (Average Receivables in a Period) / (Revenue of current month * Number of Days in the Period.

 

What's more, everything should be relative to the period. What does 'Revenue of current month' do in there?

Thank you for your response. I am really confused with this one. Do you have a suggestion? Thank you.

 

Hi @deniseg ,

 

'Month Year Date'[Date] is the date column of a marked date table. And Try the following formula:

 

Average Receivables = 
CALCULATE(
    AVERAGE('AR v AP Database'[Amount]),
    DATESINPERIOD( 'Month Year Date'[Date], LASTDATE('AR v AP Database'[Date]), -2, MONTH ), 
    FILTER(
        ALL('AR v AP Database'),
        'AR v AP Database'[AR v AP] = "AR"
    ),
    GROUPBY('AR v AP Database','AR v AP Database'[AR v AP])
)

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

Thank you, this worked for me!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.