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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
WalterBuck
Frequent Visitor

Billing Over Multiple Months Calculating Days and Amount billed per Month

Hello,

 

I am trying to create a model for utilities billing to help accounting team do accruals. I basically have three tables. 

1. Master ID list of all accounts 

2. Billing per acct (see below basic setup)

WalterBuck_0-1746038326625.png

3. Calendar table

So the goal is for the model to calculate the average amount billed per day based on historical data (easy enough) and calculate the number of days in accrual period that are billed / missing bills. (normally looking per month but will be accruing for multiple months at one time). I have been researching online and found a lot of great videos on events in progress but this is mostly to tell you for example how many accts were billed sometime during a month. Meaning if an acct was billed for 1 day it would count same as one that was billed for 31 days. I need to know per acct how much each acct was billed during any given month. I'd also like to be able to do the same calculation with the invoice amount so I can show the regularity of the billing over service periods (obviously that part would be an average since I don't have daily level invoice amt detail). I can't seem to figure out the right approach to getting this going. Any advice especially on getting days billed in a particular period?

1 ACCEPTED SOLUTION
techies
Super User
Super User

Hi @WalterBuck As i understand, we can create an expanded billing table to break each billing period into daily rows and assign amount per day like this

 

BillingExpanded =
ADDCOLUMNS (
    GENERATE (
        Billing,
        VAR StartDate = [Service Start]
        VAR EndDate = [Service Stop]
        RETURN
            CALENDAR(StartDate, EndDate)
    ),
    "DailyAmount",
        DIVIDE([Amount billed],
               DATEDIFF([Service Start], [Service Stop], DAY) + 1
        )
)
 
and then measure
 
MonthlyAccrual =
SUM(BillingExpanded[DailyAmount])
Power BI & Microsoft Fabric
PL-300 | DP-600 | DP-700 Certified

View solution in original post

1 REPLY 1
techies
Super User
Super User

Hi @WalterBuck As i understand, we can create an expanded billing table to break each billing period into daily rows and assign amount per day like this

 

BillingExpanded =
ADDCOLUMNS (
    GENERATE (
        Billing,
        VAR StartDate = [Service Start]
        VAR EndDate = [Service Stop]
        RETURN
            CALENDAR(StartDate, EndDate)
    ),
    "DailyAmount",
        DIVIDE([Amount billed],
               DATEDIFF([Service Start], [Service Stop], DAY) + 1
        )
)
 
and then measure
 
MonthlyAccrual =
SUM(BillingExpanded[DailyAmount])
Power BI & Microsoft Fabric
PL-300 | DP-600 | DP-700 Certified

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.