Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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! |
|
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |