Forum Discussion

Berrcikk's avatar
Berrcikk
Frequent Visitor
2 years ago
Solved

KPI Visual - target value

Hi, I’m having a problem with creating a simple report with one chart and one target visual. Let’s assume that in my model, I have fact table with total sales,product column and dim calendar. What ...
  • Ritaf1983's avatar
    Ritaf1983
    2 years ago

    Hi Berrcikk 
    You can use isinscope function to manipulate with the date hierarchies and calculate your goal according to the selections.
    Please refer to the attached video :
    https://www.youtube.com/watch?v=_p9E8fiDRDw

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

  • Ritaf1983's avatar
    Ritaf1983
    2 years ago

    Hi Berrcikk 
    INSCOPE / Isfiltered will work, as the "goal" of the card filtered by bars on the graph.

  • Ritaf1983's avatar
    Ritaf1983
    2 years ago

    Hi Berrcikk 
    You need to apply the needed logic for goals based on the hierarchy filter, if i understood you correctly, on year it should be a year ago, quarter, quarter ago, etc . 
    So it something like :
    test isincscope =
    VAR date1 =
        MAX ( DimCalendar[Date] )
    VAR vMonth =
        CALCULATE (
            SUM ( vFactSales[Total Sales] ),
             datedadd( vFactSales[Date] ,-1,month)
        )
    VAR vQuarter =
        CALCULATE (
            SUM ( vFactSales[Total Sales] ),
            datedadd( vFactSales[Date] ,-1,quarter)
        )
    VAR vYear =
        CALCULATE (
            SUM ( vFactSales[Total Sales] ),
            datedadd ( vFactSales[Date] ,-1,Year)
        )
    VAR scope1 =
        SWITCH (
            TRUE (),
            ISINSCOPE ( DimCalendar[Date].[Month] )vMonth,
            ISINSCOPE ( DimCalendar[Date].[Month] )vQuarter,
            ISINSCOPE ( DimCalendar[Date].[Month] )vYear,
            1
        )
    RETURN
        scope1