Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I am preparing a report that counts backlogged complaints.
This is the schema.
They want the complaints (RS Case) counts by 3 different categories: RS Cases[Region], RS Cases[Program] & RS Cases[Priority]. I created a parameter called _LTCR_Dimension_Par:
_LTCR_Dimension_par = {
("Region", NAMEOF('RS Cases'[Region]), 0),
("Program", NAMEOF('RS Cases'[Program]), 1),
("Priority", NAMEOF('RS Cases'[Priority]), 2)
}I have also created measures for the different types of case counts. I put these measures in an Insight parameter.
_LTCR_Insights_par = {
("Current Month Backlog", NAMEOF('Measure'[Backlog]), 0),
("Backlog Intakes Closed This Month", NAMEOF('Measure'[Backlog Intakes Closed]), 1),
("Current Month LOF Backlog", NAMEOF('Measure'[LOF_Backlog Insight]), 2),
("LOF Backlog Intakes Closed This Month", NAMEOF([LOF_Backlog Closed Insight]), 3),
("Current ANE Backlog", NAMEOF('Measure'[ANE Backlog]), 4),
("ANE Backlog Intakes Closed This Month", NAMEOF('Measure'[ANE Backlog Intakes Closed]), 5)
}I am using these 2 parameters in this visual:
The button slicer (below the card visual in the upper left) uses the _LTCR Insights_par parameter.
The slicer beneath with the radio buttons is the _LTCR_Dimenions_par.
This all works great. Click on the button, and all the visuals change as expected. However, I have one issue I can't resolve.
There is a measure in the Insights parameter that counts complaints for a select set of Programs (one of the dimensions).
LOF Backlog =
CALCULATE([Backlog], 'RS Cases'[Program] in {"Assisted Living", "DAHS", "DAHS-ISS", "DAHS-ISSONLY"}
)I ran into an issue with this measure if the user selected it (Current Month LOF Backlog) and the Program filter: The bar chart displayed the total count for each program and not the individual count. I fixed that issue by creating a 2nd measure:
LOF Backlog by Program =
VAR SelectedProgram = SELECTEDVALUE('RS Cases'[Program])
RETURN
IF(
SelectedProgram IN {"Assisted Living", "DAHS", "DAHS-ISS", "DAHS-ISSONLY"},
CALCULATE([Backlog], 'RS Cases'[Program] = SelectedProgram),
0
)Then I created a 3rd measure that replaced the orginial measure in the Insight parameter. This measure checks to see what selections the user has made. If user selected LOF Insight and Program from the Dimension parameter, then it uses the LOF Backlog by Program measure.
The bar charts work perfectly now.
LOF_Backlog Insight =
VAR SelectedParameter = SELECTEDVALUE(_LTCR_Dimension_par[Reg-Prog-Priority_par Order])
Var SelectedInsight = SELECTEDVALUE(_LTCR_Insights_par[_LTCR_Insights_par Order])
//Determine if the parameter value selected if LOF Insight and Program dimension
RETURN
SWITCH(
TRUE(),
SelectedParameter = 1 && SelectedInsight = 2,[LOF Backlog by Program],
[LOF Backlog]
)But, now the card visual in the upper left is not working when the user selects the LOF Insight, and the Program dimension, it displays 0.
In layman's terms I know it is giving me a zero because the card visual doesn't know what programs are selected.
I am not sure if there is a way to fix this problem. I am not even sure I have described it correctly.
Sample Data:
| RS Case No | Region | Program | Priority |
| 0111 | 01 | DAHS | Facility 18-day |
| 0113 | 06 | Nursing | Facility 30-day |
| 0115 | 08 | Assisted Living | Facility 18-day |
| 0117 | 03 | DAHS-ISS | Facility 14-day |
| 0119 | 02 | Nursing | Facility 24 hour |
| 0121 | 05 | Assisted Living | Facility 14-day |
| 0123 | 07 | DAHS | Facility 18-day |
| 0125 | 03 | Nursing | Facility 14-day |
| 0127 | 09 | Assisted Living | Facility 14-day |
With the data above, if the user selected Current Month LOF Backlog from the button slicer and any of the slicer selections for Region, Program or Priority, the card visual should display 6.
Thank you in advance.
Solved! Go to Solution.
Hi @Txtcher ,
Thanks @lbendlin for the follow-up and for explaining everything so clearly.
You’re absolutely right the card is giving you 0 because it doesn’t have a specific program in context the way your bar chart does. The fix is to let the measure fall back to the overall LOF backlog whenever there isn’t exactly one program in play. That way your bar chart still works, but your card will also show the right total.
You can adjust your measure in bellow way.
LOF_Backlog Insight =
VAR SelectedParameter = SELECTEDVALUE(_LTCR_Dimension_par[Reg-Prog-Priority_par Order])
VAR SelectedInsight = SELECTEDVALUE(_LTCR_Insights_par[_LTCR_Insights_par Order])
VAR ProgramFilter = HASONEVALUE('RS Cases'[Program])
RETURN
SWITCH(TRUE(), SelectedParameter = 1 && SelectedInsight = 2 && ProgramFilter, [LOF Backlog by Program],SelectedInsight = 2, [LOF Backlog],[Backlog])
Now you can achieve
Just let you know that, don’t rely only on the parameter, also check whether a single Program is actually in context. If not, show the total.
This small tweak should make both the card and the bar chart behave exactly the way you described. If you still face any issues, please share sample data are PBIX if there is no senstive data. Happy to help you.
Thanks,
Akhil.
Hi @Txtcher ,
Thanks @lbendlin for the follow-up and for explaining everything so clearly.
You’re absolutely right the card is giving you 0 because it doesn’t have a specific program in context the way your bar chart does. The fix is to let the measure fall back to the overall LOF backlog whenever there isn’t exactly one program in play. That way your bar chart still works, but your card will also show the right total.
You can adjust your measure in bellow way.
LOF_Backlog Insight =
VAR SelectedParameter = SELECTEDVALUE(_LTCR_Dimension_par[Reg-Prog-Priority_par Order])
VAR SelectedInsight = SELECTEDVALUE(_LTCR_Insights_par[_LTCR_Insights_par Order])
VAR ProgramFilter = HASONEVALUE('RS Cases'[Program])
RETURN
SWITCH(TRUE(), SelectedParameter = 1 && SelectedInsight = 2 && ProgramFilter, [LOF Backlog by Program],SelectedInsight = 2, [LOF Backlog],[Backlog])
Now you can achieve
Just let you know that, don’t rely only on the parameter, also check whether a single Program is actually in context. If not, show the total.
This small tweak should make both the card and the bar chart behave exactly the way you described. If you still face any issues, please share sample data are PBIX if there is no senstive data. Happy to help you.
Thanks,
Akhil.
@v-agajavelly , Many, many thanks to you. This has fixed the issue and I am so very grateful to you for taking the time to respond.
I did understand the card visual was giving me a 0 because it lacked context but could not come up with a way to solve the problem. Your solution works beautifully.
Again, thank you. I have learned so much here in this forum. It has been invaluable to me.
Field Parameters happen "before" Visual Calculations. Visual Calculations have no idea where the data came from that they are acting upon. You would have to drop the idea of visual calculations and use measures instead.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 25 |
| User | Count |
|---|---|
| 124 | |
| 87 | |
| 70 | |
| 66 | |
| 65 |