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
Awoodfor
Frequent Visitor

Periodic Billing

Hello all, I am having some issues with trying to get the Periodic Billing Dax Formula to work  i have contracts that can be 1,2 or 3 year contract with Revenue recognized monthly with the first and last months being prorated.  

I get the 

Awoodfor_0-1673020606251.png

and i am not 100% why i verified each fields to make sure it wasnt a text field.  any help would be appreciated. Thank you

 

Total Amount =
VAR tmpCalendar = ADDCOLUMNS('DateDim',"Month",MONTH('DateDim'[FullDate]),"Year",YEAR('DateDim'[FullDate]),"MonthYear",VALUE(YEAR(DateDim[FullDate]) & FORMAT(MONTH(DateDim[FullDate]),"0#")))
VAR tmpBilling = ADDCOLUMNS(BillingContractItem,"MonthYearBegin",VALUE(YEAR('BillingContractItem'[RevenueStartDate]) & FORMAT(MONTH(BillingContractItem[RevenueStartDate]),"0#")),
"MonthYearEnd",VALUE(YEAR(BillingContractItem[ContractEndDate]) & FORMAT(MONTH(BillingContractItem[ContractEndDate]),"0#")))
VAR tmpTable =
SELECTCOLUMNS(
FILTER(
GENERATE(
tmpBilling,
SUMMARIZE(tmpCalendar,[Year],[Month],[MonthYear])
),
[MonthYear] >= [MonthYearBegin] &&
[MonthYear] <= [MonthYearEnd]
),
"Customer",BillingContractItem[Name],
"Year",[Year],
"Month",[Month],
"Amount",BillingContractItem[TotalContractItemValue]
)
RETURN SUMX(tmpTable,[Amount])
1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
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.