Forum Discussion
KPI Card Target (MaxMonthlyExports) Not Showing Correct Value When Using Year 2024 Slicer
- 1 year ago
Hi Anonymous,
Thank you for your time.
I have fixed the issue where the KPI cad does not respect the Year slicer passed on.
I fixed it by changing the logic for .MaxMonthlyExports measure, I used ALLSELECTED(tDate) which will respect the filters coming from outside while ignoring the filters appled inside query ( Source: ALLSELECTED – DAX Guide )
MaxMonthlyExports = VAR MaxExportValue = IF( NOT ISBLANK([MonthlyExports]), CALCULATE( MAXX( VALUES(tDate[Month Year]), [MonthlyExports] ), ALLSELECTED(tDate) ), BLANK() ) RETURN MaxExportValueResults for KPI card:
1. When no slicer applied:
The latest Month Exports are 674 for March 2025 at Value field. ✅
The Max Exports Month are 4350 for February 2025 at Goal field aka Taget field. ✅
2. When slicer year 2024 applied:
The latest Month Exports are 2599 for December 2024 at Value field. ✅
The Max Exports Month are 3074 for October 2024 at Goal field aka Taget field. ✅
As I found the issues resolved, I am myself marking this reply as the solution.
Please let me know if there are questions or any issues.
Thank you.
Hi dheerajyss,
We suggest you change the Trend axis ato Date_Year, as shown below:
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- dheerajyss1 year agoFrequent Visitor
Hi Anonymous ,
Thank you for responding.
My observations from your suggested solution:
- I noticed that including only the Year from the Date hierarchy resolves the issue with the KPI card and now displays the correct Max exports found for the 2024 year slicer,
- Also it displays only the year in the KPI card as we included only the year,
- However, I noticed it causes the background trend to disappear in the KPI card up on including only the Year in trend axis field.
What I am expecting:
- Ideally, I would like both the Year and Month to appear within the KPI card (for this we need to include the Year Month Number from tDate), while retaining the background trend and also to get the desired Max export value for the given slicer 2024.
If there is no alternative way to achieve this, I might have to let go of this requirement for now.
My Questions:
- I am curious as to why using both Month and Year in the trend axis seems to affect the Goal Max Export data value in the KPI card for slicer year 2024. Could you clarify this?
- Is the Max export measure correct?
Thank you again for your time and help!