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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jonnyA
Responsive Resident
Responsive Resident

Calculate Payment Date minus Billed Date

I work for a Medical Billing Company and I have been asked to create a formula on how long it takes a claim to be paid from Billed Date to Paid Date.

 

I'd assume the formula is Paid Date minus Billed Date, but I do not know how to write that formula in Power BI.  I tried quick measure, however, that did not work.

 

Count of Payment_Date minus Count of Billed_Date =
COUNTA('vw_Demo_Payments_Dataset_BP'[Payment_Date]) - COUNTA('vw_Demo_Payments_Dataset_BP'[Billed_Date]).
 
Any suggestions on how I can make my formula work?
 
Thanks in advance!
1 ACCEPTED SOLUTION
jonnyA
Responsive Resident
Responsive Resident

Payment Date minus Billed Date = datediff(selectedvalue(Dataset_Payments_Dataset_BP[Billed_Date]),selectedvalue(Dataset_Payments_Dataset_BP[Payment_Date]), day )

View solution in original post

4 REPLIES 4
jonnyA
Responsive Resident
Responsive Resident

Payment Date minus Billed Date = datediff(selectedvalue(Dataset_Payments_Dataset_BP[Billed_Date]),selectedvalue(Dataset_Payments_Dataset_BP[Payment_Date]), day )

nsexton12
Resolver II
Resolver II

You can use the DATEDIFF function! See documentation below. 

 

https://learn.microsoft.com/en-us/dax/datediff-function-dax

 

More specifically, click new measure instead of quick measure. Then use:

 

DATEDIFF('vw_Demo_Payments_Dataset_BP'[Payment_Date],'vw_Demo_Payments_Dataset_BP'[Billed_Date],DAY)

 

If this works for you, please mark as a solution!

jonnyA
Responsive Resident
Responsive Resident

Got Tips on how to write that formula using the fields I have?

 

Like, what woould that formula look like?

I updated my answer above to include that information.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors