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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
WalterBuck
Regular 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
Solution Sage
Solution Sage

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 | Blog: medium.com/@cseprs_54978

View solution in original post

1 REPLY 1
techies
Solution Sage
Solution Sage

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 | Blog: medium.com/@cseprs_54978

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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