Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Katiek
Helper II
Helper II

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

 

1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

Hi @Katiek,

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

_AAndrade_1-1715601760710.png

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:

_AAndrade_0-1715601746336.png
If you could share more information about your model or share a pbix file with same that I could help you

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

8 REPLIES 8
_AAndrade
Super User
Super User

Hi @Katiek,

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

_AAndrade_1-1715601760710.png

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:

_AAndrade_0-1715601746336.png
If you could share more information about your model or share a pbix file with same that I could help you

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




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.

 

Katiek_2-1715603924166.png

The value should be 2.29 in 2023

 

 

@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.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Hi @_AAndrade 

The 2 tables are linked together through the field year.

Katiek_0-1715605363188.png

 

@_AAndrade 

oh my gosh, i just figured it out. I changed the filter direction in the relationship to both and it worked.

Thank you so much for your help. This problem has been on my mind and taking forever to solve.

Great. As I thought is a relationship issue.
By the way, good practice says that the correct relationship between the "Date" table and the destination should be "One to many", so the date table should filter the destination table and not the other way round.
This relationship will works fine as well.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




_AAndrade
Super User
Super User

Hi @Katiek,

 

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





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.