Forum Discussion

renlaforest's avatar
renlaforest
Helper I
4 years ago
Solved

Cumulative Daily Target

Hi - It's embarassing how many hours I've spent trying to figure this out.   My Data Model has a table called Project Setup with project in each row. Each project has a column called Start Date, Cl...
  • tamerj1's avatar
    4 years ago

    Hi renlaforest 
    Here is the sample file with the solution https://we.tl/t-pHo4kYyRle

    ENTargetToDate = 
    VAR CrrentDate = MAX ( EnumDates[Date] )
    VAR FirstDateInFilter = CALCULATE ( MIN ( EnumDates[Date] ), ALLSELECTED () )
    VAR NumberOfDays = DATEDIFF ( FirstDateInFilter, CrrentDate, DAY ) + 1
    VAR ProjectTarget = SELECTEDVALUE ( 'ProjectSetup'[DailyENTarget] )
    RETURN
        ProjectTarget * NumberOfDays