This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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 ?
| Contract | QTY(kg/per day) | Price (€/kg) | Produkte | Startdate | Enddate |
| 2025-1 | 1000 | 37,14 | 2026/CA | 01.01.2026 | 31.12.2026 |
| 2025-2 | 2000 | 42,335 | 2026/Q1 | 01.01.2026 | 31.03.2026 |
| 2025-3 | 2000 | 35,79 | 2026/Wi | 01.10.2026 | 31.03.2027 |
| 2025-4 | 1000 | 30,84 | 2027/CA | 01.01.2027 | 31.12.2027 |
| 2025-5 | 3000 | 30,24 | 2027/Wi | 01.10.2027 | 31.03.2028 |
| 2025-6 | 1000 | 27,815 | 2028/CA | 01.01.2028 | 31.12.2028 |
| 2025-7 | 15000 | 27,87 | 2028/Q4 | 01.10.2028 | 31.12.2028 |
| 2025-8 | 5000 | 69,05 | 2028/CA | 01.01.2028 | 31.12.2028 |
| 2025-9 | 2300 | 31,315 | 2027/CA | 01.01.2027 | 31.12.2027 |
| 2025-10 | 2300 | 27,822 | 2028/CA | 01.01.2028 | 31.12.2028 |
| 2025-11 | 9000 | 36,08 | 2027/Q1 | 01.01.2027 | 31.03.2027 |
Solved! Go to Solution.
@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.
Proud to be a Super User! |
|
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.
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.
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
@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.
Proud to be a Super User! |
|
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 39 | |
| 33 | |
| 24 | |
| 23 |