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
TheSweeper
Helper I
Helper I

Help with Formula for Days in AR

Hello!  Good Afternoon.  I am needing some help with a formula for showing casing the # of Days in AR.  Below you will find all the formulas I used inside of my report.  I also have provided several screenshots.  I am not sure what I am doing wrong.  Please help!!!!  My teammates are getting frustrated with me. 😞 I can't figure it out. 

Thank you so much in advance!

Sincerely,

Amanda 

 

Last 6 Month Charges = 1,689,901.39

How I got the Last 6 Month Charges is by using the Date (relative date) filter.

I also had a formula called IsLatest  ..that is a True / False statement set up to only sum charges by latest modified date so it wouldn't be adding up duplicate values.

TheSweeper_0-1668631997570.png

 

Count of Days in Last 6 Months = 184

I used my Calendar Table and chose the column “Days in Month.” I then used the Date Filter to only count the days in the last 6 months. 

TheSweeper_1-1668631997584.png

 

Average Charges in Last 6 Months = 8,966.86

I then set up a measure to calculate the Average Charges by dividing the Last 6 months charges by the # number of days in last 6 months.

I also applied the date filter for the last 6 months.

DAX FORMULA USED: Avg Charges = DIVIDE([Last 6 month Charges], COUNT(_Calendar[Days in Month]),0)

TheSweeper_2-1668631997593.png

 

Total AR = 593,560.15

I just used my Charges Table and Chose "Balance"

 

Total AR Days = 66 ($ 59, 3560.15 Total AR / $ 8,966.86 Average Charge in last 6 months)

*****When setting up this formula I get the following value = 45

Using dax formula = 

AR Days = DIVIDE([Total Balance],[Avg Charges], 0)

TheSweeper_3-1668631997607.png

 

1 ACCEPTED SOLUTION
TheSweeper
Helper I
Helper I

Hello!  

Yes.  When you divide " $593,560.15" / "$ 8,966.86"  the answer is "66." In BI, when I using the below formula it gives me 45.  I am using the following formula:

AR Days = DIVIDE([Total Balance], [Avg Charges], 0)  *Using the following Filter Date: (Relative Date is in last 6 months)

 

Here are the other forumula I used:

1. Total Balance = SUM(Charges[Balance])

........Total Balance (which is also known as "Total AR")

 

2.  Last 6 month ChargesCALCULATE([Total Charges], DATESINPERIOD(_Calendar[Date], MAX(_Calendar[Date]), -184, DAY))  ....I didn't know how to go back 6 months so I just used "184" days.  I know sometimes it may not be 184 days but at least I got something in the meantime.  *Using the following Filter Date: (Relative Date is in last 6 months)

 

3.  Avg Charges = DIVIDE([Last 6 month Charges], COUNT(_Calendar[Days in Month]),0)

*Using the following Filter Date: (Relative Date is in last 6 months)

 

Hope this helps 

View solution in original post

2 REPLIES 2
TheSweeper
Helper I
Helper I

Hello!  

Yes.  When you divide " $593,560.15" / "$ 8,966.86"  the answer is "66." In BI, when I using the below formula it gives me 45.  I am using the following formula:

AR Days = DIVIDE([Total Balance], [Avg Charges], 0)  *Using the following Filter Date: (Relative Date is in last 6 months)

 

Here are the other forumula I used:

1. Total Balance = SUM(Charges[Balance])

........Total Balance (which is also known as "Total AR")

 

2.  Last 6 month ChargesCALCULATE([Total Charges], DATESINPERIOD(_Calendar[Date], MAX(_Calendar[Date]), -184, DAY))  ....I didn't know how to go back 6 months so I just used "184" days.  I know sometimes it may not be 184 days but at least I got something in the meantime.  *Using the following Filter Date: (Relative Date is in last 6 months)

 

3.  Avg Charges = DIVIDE([Last 6 month Charges], COUNT(_Calendar[Days in Month]),0)

*Using the following Filter Date: (Relative Date is in last 6 months)

 

Hope this helps 

djurecicK2
Super User
Super User

Hi @TheSweeper ,

 Could you possibly post an example of the end result you are looking for?

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