Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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
Year | Target |
2022 | 2.48 |
2023 | 2.29 |
2024 | 2 |
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
Solved! Go to Solution.
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
Proud to be a Super User!
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
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.
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.
Proud to be a Super User!
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.
Proud to be a Super User!
Hi @Katiek,
It depends on how you build your model, but try the following:
MIN('YourTableName'[Target])
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |