Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

KPI visual target help

I am using the default KPI visual, but am having trouble with a calculated target value. I am using YTD costs for the indicator and fiscal year for the trend. I would like to use the average costs ov...
  • v-lili6-msft's avatar
    v-lili6-msft
    7 years ago

    hi, Anonymous 

    You could try this formula as below:

    Measure 2 = 
    VAR __LAST_DATE =
        ENDOFYEAR ( 'Date'[Date] )
    VAR __DATE_PERIOD =
        DATESBETWEEN (
            'Date'[Date],
            STARTOFYEAR ( DATEADD ( __LAST_DATE, -6, YEAR ) ),
            ENDOFYEAR ( DATEADD ( __LAST_DATE, -1, YEAR ) )
        )
    RETURN
        AVERAGEX (
            CALCULATETABLE (
                SUMMARIZE ( VALUES ( 'Date' ), 'Date'[Date].[Year] ),
                __DATE_PERIOD
            ),
            [Cost YTD]
        )

    Result:

    And here is pbix file, please try it.

     

    Best Regards,

    Lin