Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

KPI Card cannot show YTD

My KPI card

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

    Based on my testing, please try the following methods:

    1.Create the sample table.

    2.Create the measure to calculate kpi values.

    KPI = 
    var _numer = SUMX('Table', 'Table'[NUMERATOR])
    var _de = SUMX('Table', 'Table'[DENOMINATOR])
    RETURN
    DIVIDE(_numer, _de)
    

    3.Drag the measure into the card visual. The result is shown below.

    Best Regards,

    Wisdom Wu

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

3 Replies

  • Anonymous , Try using below method

     

    Create a measure for the cumulative sum of the numerator:

     

    Cumulative Numerator =
    CALCULATE(
    SUM(G[NUMERATOR]),
    FILTER(
    ALLSELECTED(G),
    G[Date] <= MAX(G[Date])
    )
    )


    Create a measure for the cumulative sum of the denominator:
    Cumulative Denominator =
    CALCULATE(
    SUM(G[DENOMINATOR]),
    FILTER(
    ALLSELECTED(G),
    G[Date] <= MAX(G[Date])
    )
    )

     


    Create the KPI value measure using the cumulative sums:
    KPI VALUE =
    DIVIDE(
    [Cumulative Numerator],
    [Cumulative Denominator]
    )

     

    ALLSELECTED(G) ensures that the calculation respects the current context of filters applied in your report.

  • Anonymous , Try using var

     

    KPI VALUE =
    VAR CumulativeNumerator =
        CALCULATE(
            SUM(G[NUMERATOR]),
            FILTER(
                ALL(G[DateColumn]),
                G[DateColumn] <= MAX(G[DateColumn])
            )
        )

    VAR CumulativeDenominator =
        CALCULATE(
            SUM(G[DENOMINATOR]),
            FILTER(
                ALL(G[DateColumn]),
                G[DateColumn] <= MAX(G[DateColumn])
            )
        )

    RETURN
        DIVIDE(CumulativeNumerator, CumulativeDenominator)
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Based on my testing, please try the following methods:

    1.Create the sample table.

    2.Create the measure to calculate kpi values.

    KPI = 
    var _numer = SUMX('Table', 'Table'[NUMERATOR])
    var _de = SUMX('Table', 'Table'[DENOMINATOR])
    RETURN
    DIVIDE(_numer, _de)
    

    3.Drag the measure into the card visual. The result is shown below.

    Best Regards,

    Wisdom Wu

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