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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
iimlromero
Frequent Visitor

DSO DAys, from different tables

Hello Imam tring to do the following calculation but still cant.

 

1)  Fact Table with sales (day, invoice number, ammount, customer, etc...)

2) Table with Customer debt for each friday.

 

I would like to calculate this for each available debt in the second table:

 

DaysOfDebt = Debt x 60 / Cummulated Invoiced ammount of last 60 days.

 

I hope I was clear in what i am tring to do.

 

Thanks, and excuse my poor english.

Max

 

Sin título.png

 

1 ACCEPTED SOLUTION
technolog
Super User
Super User

To calculate the Days Sales Outstanding (DSO) based on the sales data and the customer debt data for each Friday, you can follow these steps in DAX:

Step 1: Create a Measure for Cumulative Invoiced Amount of Last 60 Days
First, create a measure that calculates the cumulative invoiced amount over the last 60 days:

CumulativeInvoiceLast60Days =
CALCULATE(
SUM('BaseFacturacion'[Cantidad]),
FILTER(
ALL('BaseFacturacion'),
'BaseFacturacion'[Fecha] >= MAX('BaseFacturacion'[Fecha]) - 60 &&
'BaseFacturacion'[Fecha] <= MAX('BaseFacturacion'[Fecha])
)
)
Step 2: Create a Measure for Debt
Next, create a measure for the debt from the CuentaCorriente table:

DebtAmount = SUM('CuentaCorriente'[Deuda ($)])
Step 3: Create the DSO Measure
Now, combine the cumulative invoiced amount and the debt to calculate the DSO:

DaysOfDebt =
IF(
[CumulativeInvoiceLast60Days] <> 0,
[DebtAmount] * 60 / [CumulativeInvoiceLast60Days],
BLANK()
)

View solution in original post

1 REPLY 1
technolog
Super User
Super User

To calculate the Days Sales Outstanding (DSO) based on the sales data and the customer debt data for each Friday, you can follow these steps in DAX:

Step 1: Create a Measure for Cumulative Invoiced Amount of Last 60 Days
First, create a measure that calculates the cumulative invoiced amount over the last 60 days:

CumulativeInvoiceLast60Days =
CALCULATE(
SUM('BaseFacturacion'[Cantidad]),
FILTER(
ALL('BaseFacturacion'),
'BaseFacturacion'[Fecha] >= MAX('BaseFacturacion'[Fecha]) - 60 &&
'BaseFacturacion'[Fecha] <= MAX('BaseFacturacion'[Fecha])
)
)
Step 2: Create a Measure for Debt
Next, create a measure for the debt from the CuentaCorriente table:

DebtAmount = SUM('CuentaCorriente'[Deuda ($)])
Step 3: Create the DSO Measure
Now, combine the cumulative invoiced amount and the debt to calculate the DSO:

DaysOfDebt =
IF(
[CumulativeInvoiceLast60Days] <> 0,
[DebtAmount] * 60 / [CumulativeInvoiceLast60Days],
BLANK()
)

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.