Forum Discussion

Katiek's avatar
Katiek
Helper II
2 years ago
Solved

Dynamic Target in KPI Card

Hi Everyone, 

Our targets for employee injuries change every year. In the KPI card i want to see the target for the year that i select in the slicer.

 

I have the following table called Targets

YearTarget
20222.48
20232.29
20242

 

How do I write a measure that shows the right target value in the KPI card when I select the year in the slicer?

 

Thanks heaps for your help

 

  • Hi Katiek,

    Take a look at my simple example:
    I create a table with this data:

    I used this DAX measure:

    TargetYear = MIN(T_Targets[Target])

     

    And the value in the card visual changing according to the value from the Year of the slicer. Here is an example:


    If you could share more information about your model or share a pbix file with same that I could help you

     

8 Replies

  • _AAndrade's avatar
    _AAndrade
    Resident Rockstar

    Hi Katiek,

     

    It depends on how you build your model, but try the following:
    MIN('YourTableName'[Target])

    • Katiek's avatar
      Katiek
      Helper II

      Hi _AAndrade 

      Thanks but this just gives me the minimum value in the table, regardless of what year in the slicer I select.

       

      Thanks, KatieK

  • _AAndrade's avatar
    _AAndrade
    Resident Rockstar

    Hi Katiek,

    Take a look at my simple example:
    I create a table with this data:

    I used this DAX measure:

    TargetYear = MIN(T_Targets[Target])

     

    And the value in the card visual changing according to the value from the Year of the slicer. Here is an example:


    If you could share more information about your model or share a pbix file with same that I could help you

     

    • Katiek's avatar
      Katiek
      Helper II

      Hi _AAndrade 

       

      I'm not sure why it's not working. My table of targets is called Zielwert and the column with the targets is [Zielwert]. It doesn't matter what year I select, i get the same target value.

       

      The value should be 2.29 in 2023

       

       

      • _AAndrade's avatar
        _AAndrade
        Resident Rockstar

        Katiek the date column that you have on the slicer is from the same table?
        If the target values and the dates on the slicer are from different tables you need to link them.