Forum Discussion
KPI Card visual showing wrong value when 'Select All' is used
I have a kpi card showing Secured and Potential Revenue by Month and Financial year, however when All is selected in Month slicer and Financial year slicer, the value is wrong it seems to be just showing the value for September for all years. Any advice on how to get round this? Would rather it totalled up all the values for every month and financial year if 'All' was selected in the 2 slicers. Thanks
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.
12 Replies
- bhanu_gautamSuper User
patrickbrooks13 Ensure that the DAX measure used in your KPI card is correctly summing up the values across all selected months and financial years. You might need to use functions like ALL, ALLSELECTED, or REMOVEFILTERS to ignore the slicer filters when "All" is selected.
TotalRevenue =
CALCULATE(
SUM(RevenueTable[Revenue]),
ALLSELECTED(RevenueTable[Month]),
ALLSELECTED(RevenueTable[FinancialYear])
)Ensure that the filter context is correctly set up in your report. Sometimes, the issue might be due to the interaction between different visuals and slicers on the report page.
Add a table visual to your report to display the raw data for the selected months and financial years. This can help you verify whether the data is being filtered correctly when "All" is selected.
Ensure that the slicers are set up correctly and that there are no additional filters or interactions that might be affecting the KPI card.
- mdaatifraza5556Super User
Hi patrickbrooks13
Can you please provide what DAX you are writing to get your result?
If you are not using the below dax, please try it once.
Total Secured Revenue:=
CALCULATE(
SUM('RevenueTable'[SecuredRevenue]),
ALLSELECTED('Date'[Month], 'Date'[FinancialYear])
)
If this answers your questions, kindly accept it as a solution and give a kudos- patrickbrooks13Frequent Visitor
Hi, this is here. I have a target value in as well so it will go green if met and red if not met etc.
KPI_Value =VAR AllYears = ALL('FinancialYearTable'[FinancialYear])-- Check if all years are selected in the slicerVAR IsAllYearsSelected =COUNTROWS(VALUES('FinancialYearTable'[FinancialYear])) = COUNTROWS(AllYears)-- Total secured amount (ALL years)VAR TotalSecuredAmountAllYears =CALCULATE(SUM('Estimating PipelineAnalysis'[Amount]),FILTER(ALL('Estimating PipelineAnalysis'),'Estimating PipelineAnalysis'[Status] = "Secured"))-- Target for all yearsVAR SecuredTargetAllYears =CALCULATE(SUM('EstTarget_Budget_Summary'[TotalAmount]),USERELATIONSHIP('EstTarget_Budget_Summary'[FinancialYear], 'FinancialYearTable'[FinancialYear]),FILTER(ALL('Estimating PipelineAnalysis'),'Estimating PipelineAnalysis'[Status] = "Secured"))-- Filtered secured amount (based on slicer)VAR FilteredSecuredAmount =CALCULATE(SUM('Estimating PipelineAnalysis'[Amount]),'Estimating PipelineAnalysis'[Status] = "Secured")-- Filtered target (based on slicer)VAR FilteredSecuredTarget =CALCULATE(SUM('EstTarget_Budget_Summary'[TotalAmount]),USERELATIONSHIP('EstTarget_Budget_Summary'[FinancialYear], 'FinancialYearTable'[FinancialYear]),'Estimating PipelineAnalysis'[Status] = "Secured")-- ✅ Return blank if all years selected, otherwise return calculated KPIRETURNIF(IsAllYearsSelected,BLANK(),FilteredSecuredAmount + FilteredSecuredTarget)
- v-sgandrathiCommunity Support
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.
- patrickbrooks13Frequent Visitor
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-sgandrathiCommunity 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.