Search code examples
daxprojection

DAX create projection line on a timeline in a line chart by creating a calculated table (or other solution)


I have columns: project, target value, start date, end date. I'm able to calculate column target per day based on the project period. Starting from the below data

enter image description here

I'd need something like this:

enter image description here

To draw some linear projection like the black one below:

enter image description here

My approach would be to create calculated table and fix relationship to common calendar to create above but maybe there is better solution.

Please help to create such table or any other solution.


Solution

  • So I moved back to data transformations in M - created there table with project start date and end date. Then used below formula to create consecutive date rows in the date range in the desired output column:

    =List.Dates([start date], Number.From([end date]-[start date])+1, #duration(1, 0, 0, 0))
    

    then in DAX I used standard LOOKUPVALUE for assigning per day target value from another table so that output table looks like this:

    enter image description here

    to finally create cumulative measure on 'target cumulative' for the chart purpose: enter image description here