Forum Discussion
Cash flow Dashboard
- 1 year ago
Your expected result is a bit confusing. For Plot1, both January and February 2025 have 4 weeks of Design, so their values should be the same but your result shows otherwise. That aside, assuming the weekly spend should be plotted at the end of each week starting from the Design or Construction start date (e.g., a Design start of Jan 1, 2025 would place the first point on Jan 7), you can try the following formula.
Note: Dates refers to a disconnected calendar table that spans from the earliest to the latest of all relevant date columns.Weekly Design Spend = VAR SummaryTable = SUMMARIZE ( Data, Data[Plot No], Data[Phase], Data[Design Start Date], Data[Weekly rate], Data[Design Duration] ) VAR _GeneratedTable = GENERATE ( SummaryTable, ADDCOLUMNS ( GENERATESERIES ( 1, [Design Duration], 1 ), "@End of Week", [Design Start Date] + ( [Value] * 7 ) - 1 ) ) VAR _FilteredTable = FILTER ( _GeneratedTable, [@End of Week] IN VALUES ( Dates[Date] ) ) RETURN SUMX ( _FilteredTable, [Weekly rate] )Please see the attached pbix.
Your expected result is a bit confusing. For Plot1, both January and February 2025 have 4 weeks of Design, so their values should be the same but your result shows otherwise. That aside, assuming the weekly spend should be plotted at the end of each week starting from the Design or Construction start date (e.g., a Design start of Jan 1, 2025 would place the first point on Jan 7), you can try the following formula.
Note: Dates refers to a disconnected calendar table that spans from the earliest to the latest of all relevant date columns.
Weekly Design Spend =
VAR SummaryTable =
SUMMARIZE (
Data,
Data[Plot No],
Data[Phase],
Data[Design Start Date],
Data[Weekly rate],
Data[Design Duration]
)
VAR _GeneratedTable =
GENERATE (
SummaryTable,
ADDCOLUMNS (
GENERATESERIES ( 1, [Design Duration], 1 ),
"@End of Week",
[Design Start Date] + ( [Value] * 7 ) - 1
)
)
VAR _FilteredTable =
FILTER ( _GeneratedTable, [@End of Week] IN VALUES ( Dates[Date] ) )
RETURN
SUMX ( _FilteredTable, [Weekly rate] )
Please see the attached pbix.
Hi Thank you for the solution it was exactly what I was after