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 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
MaxExportValue
Results 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.