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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

how to calcuated accumulated monthly qty with the purchase qty and validation periodes?

I have a contract table and a date table, which I have build the realtionship among the date table (Date) with contract table( Startdate and Enddate). How shall I build the measure to calculate the accumulated qty and costs each month from 01.01.2026 ?

 

ContractQTY(kg/per day)Price (€/kg)ProdukteStartdateEnddate
2025-1100037,142026/CA01.01.202631.12.2026
2025-2200042,3352026/Q101.01.202631.03.2026
2025-3200035,792026/Wi01.10.202631.03.2027
2025-4100030,842027/CA01.01.202731.12.2027
2025-5300030,242027/Wi01.10.202731.03.2028
2025-6100027,8152028/CA01.01.202831.12.2028
2025-71500027,872028/Q401.10.202831.12.2028
2025-8500069,052028/CA01.01.202831.12.2028
2025-9230031,3152027/CA01.01.202731.12.2027
2025-10230027,8222028/CA01.01.202831.12.2028
2025-11900036,082027/Q101.01.202731.03.2027
1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Anonymous  Ensure you have a date table that spans the entire period you are interested in, from 01.01.2026 onwards. 

Make sure your date table is related to the contract table using the Startdate and Enddate fields.

 

 This measure will calculate the total quantity up to the current date in the context of your report.

Accumulated Quantity =
CALCULATE(
SUM(Contract[QTY(kg/per day)]),
FILTER(
ALL(Date),
Date[Date] <= MAX(Date[Date]) &&
Date[Date] >= Contract[Startdate] &&
Date[Date] <= Contract[Enddate]
)
)

 

This measure will calculate the total cost up to the current date.

Accumulated Cost =
CALCULATE(
SUMX(
Contract,
Contract[QTY(kg/per day)] * Contract[Price (€/kg)]
),
FILTER(
ALL(Date),
Date[Date] <= MAX(Date[Date]) &&
Date[Date] >= Contract[Startdate] &&
Date[Date] <= Contract[Enddate]
)
)

 

You can now use these measures in a report to visualize the accumulated quantities and costs over time. Make sure your report's date range starts from 01.01.2026.

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

4 REPLIES 4
v-karpurapud
Community Support
Community Support

Hi @Anonymous 

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Thank you.

v-karpurapud
Community Support
Community Support

Hi @Anonymous 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank you.

 



v-karpurapud
Community Support
Community Support

Hi @Anonymous 

Could you please confirm if your query have been resolved the solution provided by @bhanu_gautam ? If they have, kindly mark the helpful response and accept it as the solution. This will assist other community members in resolving similar issues more efficiently.

Thank you

bhanu_gautam
Super User
Super User

@Anonymous  Ensure you have a date table that spans the entire period you are interested in, from 01.01.2026 onwards. 

Make sure your date table is related to the contract table using the Startdate and Enddate fields.

 

 This measure will calculate the total quantity up to the current date in the context of your report.

Accumulated Quantity =
CALCULATE(
SUM(Contract[QTY(kg/per day)]),
FILTER(
ALL(Date),
Date[Date] <= MAX(Date[Date]) &&
Date[Date] >= Contract[Startdate] &&
Date[Date] <= Contract[Enddate]
)
)

 

This measure will calculate the total cost up to the current date.

Accumulated Cost =
CALCULATE(
SUMX(
Contract,
Contract[QTY(kg/per day)] * Contract[Price (€/kg)]
),
FILTER(
ALL(Date),
Date[Date] <= MAX(Date[Date]) &&
Date[Date] >= Contract[Startdate] &&
Date[Date] <= Contract[Enddate]
)
)

 

You can now use these measures in a report to visualize the accumulated quantities and costs over time. Make sure your report's date range starts from 01.01.2026.

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

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

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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