Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Solved! Go to Solution.
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()
)
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()
)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |