Forum Discussion
KPI Card visual showing wrong value when 'Select All' is used
- 1 year ago
Hi patrickbrooks13 ,
Thank you for raising this issue in the community.
I have reproduced your scenario in Power BI Desktop and I’m happy to confirm that I was able to achieve the expected KPI card visual output when “Select All” is used in both Month and FinancialYear slicers.
What I did:
- Created a KPI visual for Secured Revenue and another for Potential Revenue
- Built custom DAX measures using ALLSELECTED() to ensure totals across all selected months and years
- Connected both visuals to a proper DateTable
- Enabled “Select All” in the slicers
Result:
- Total Secured Revenue: 11,800
- Total Potential Revenue: 13,300
(as expected, summing all selected months and years)
To help you further, I’m attaching the .pbix file used for testing this scenario.
Feel free to download it and adapt it to your data model.If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Hi patrickbrooks13,
The issue happens because when "Select All" is used in slicers, Power BI still applies individual filters behind the scenes, which can cause the KPI Card to behave incorrectly (like showing only September).
To fix this, you need to adjust your DAX to detect when all Months and all Financial Years are selected, and then remove the filters so it sums across all data.
You can do this by comparing the number of selected months/years with the total available.
If all are selected, use ALL() to ignore slicer filters and calculate the true total.
If only some are selected, calculate based on the selection.
This way, your KPI will correctly show the total revenue across all months and years when "Select All" is chosen, instead of showing a wrong single month value.
I hope this helped! Feel free to ask any further questions. If this resolved your issue, please mark it as "Accept as Solution" and give us Kudos to assist others.
Thank you.
Hey I've tried this here code but it still isn't working :
KPI_Value :=
VAR AllYears = ALL('FinancialYearTable'[FinancialYear])
VAR AllMonths = ALL('DateTable'[Month])
VAR SelectedYears = VALUES('FinancialYearTable'[FinancialYear])
VAR SelectedMonths = VALUES('DateTable'[Month])
VAR IsAllYearsSelected =
COUNTROWS(SelectedYears) = COUNTROWS(AllYears)
VAR IsAllMonthsSelected =
COUNTROWS(SelectedMonths) = COUNTROWS(AllMonths)
VAR TotalSecuredAmountAll =
CALCULATE(
SUM('Estimating PipelineAnalysis'[Amount]),
FILTER(ALL('Estimating PipelineAnalysis'), 'Estimating PipelineAnalysis'[Status] = "Secured")
)
VAR TotalSecuredTargetAll =
CALCULATE(
SUM('EstTarget_Budget_Summary'[TotalAmount]),
USERELATIONSHIP('EstTarget_Budget_Summary'[FinancialYear], 'FinancialYearTable'[FinancialYear]),
FILTER(ALL('Estimating PipelineAnalysis'), 'Estimating PipelineAnalysis'[Status] = "Secured")
)
VAR FilteredSecuredAmount =
CALCULATE(
SUM('Estimating PipelineAnalysis'[Amount]),
'Estimating PipelineAnalysis'[Status] = "Secured"
)
VAR FilteredSecuredTarget =
CALCULATE(
SUM('EstTarget_Budget_Summary'[TotalAmount]),
USERELATIONSHIP('EstTarget_Budget_Summary'[FinancialYear], 'FinancialYearTable'[FinancialYear]),
'Estimating PipelineAnalysis'[Status] = "Secured"
)
VAR FinalAmount =
IF(
IsAllYearsSelected && IsAllMonthsSelected,
TotalSecuredAmountAll + TotalSecuredTargetAll,
FilteredSecuredAmount + FilteredSecuredTarget
)
RETURN
FinalAmount -- ✅ Return number, not text
- v-sgandrathi1 year agoCommunity Support
Hi patrickbrooks13,
In Power BI, selecting "Select All" in a slicer still applies filters for all values, rather than removing the filter context. This can cause KPI visuals to show incorrect totals, like only one month’s value.
The original DAX compares selected vs total items but doesn’t actually remove the filters.
To fix this, try using REMOVEFILTERS() in your calculation to ensure it totals all data when all items are selected.
Glad I could assist! If this answer helped resolve your issue, please mark it as Accept as Solution and give us Kudos to guide others facing the same concern.
Thank you.
- v-sgandrathi1 year agoCommunity Support
Hi patrickbrooks13,
we haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.If our response addressed by the community member for your query, please mark it as Accept Answer and click Yes if you found it helpful.
Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!
- v-sgandrathi1 year agoCommunity Support
Hi patrickbrooks13,
I wanted to check in your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply as Accepted solution and give Kudos that helped you. It would be greatly appreciated by others in the community who may have the same question.
Thank you.