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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How to calculate how many default days are clients?

Hi,

 

I have a Sales Table that shows the sale pay date and the date that the client in fact payed for the product, called "Sales Off". 

 

If today is greater than the pay date and the Sales Off cell is empty, it means that the client has default.

 

How can I build a measure that shows how many default days each client is?

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Anonymous Perhaps something like:

Days in Default Measure = 
  VAR __Today = TODAY()
  VAR __PayDate = MAX('Table'[Sales Pay Date])
  VAR __SalesOff = MAX('Table'[Sales Off])
RETURN
  IF(__Today > __PayDate && ISBLANK(__SalesOff),(__Today - __PayDate)*1.,BLANK)
  


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

This will return me just a single value, but I need a value for each client. I have build a measure to sum the amount defaulted, maybe this can help to understand what I mean:

 

CALCULATE(
sum('Sales Table'[Amunt]),
FILTER(
'Sales Table',
'Sales Table'[sales Off] = BLANK() &&
'Sales Table'[pay date] < TODAY()
)
)

@Anonymous Well, I assumed that you would put the measure into something like a table visualization along with the client or whatever you needed it by. So, create a table visual and put the client field in the Values field well. Then place the measure into the field well.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I will do this too, but I also need to do the geometric avarege of days default

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.