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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Target =
Switch( true(),
SELECTEDVALUE(Table[ProductName]) = "ProductA", 0.80,
SELECTEDVALUE(Table[ProductName]) = "ProductB", 0.72,
SELECTEDVALUE(Table[ProductName]) = "ProductC", 0.72
)
Please help!
I have a line and clustered column chart. I'm trying to create a target line based on ProductName selection in filters.
I don't have any issues when selecting one ProductName at a time. When I select more than one ProductName, I'm getting unexpected results (see ProductB and ProductC image, last image).
Trying to accomplish this...
If same target values ProductName are selected, show the correct target value. (for example: selecting ProductB and ProductC at the same time)
If different target values ProductName are selected, show no target value.
Target line = pink dotted line
ProductB selected: (Good)
ProductC selected: (Good)
ProductB and ProductC selected: (This is not what I want. I'm trying to get all columns to have the target line)
Solved! Go to Solution.
@EZiamslow , Try like
Target = if( countrows(allselected(Table[ProductName])) =1 ,
Switch( true(),
"ProductA" in allselected(Table[ProductName]) , 0.80,
"ProductB" in allselected(Table[ProductName]) , 0.72,
"ProductC" in allselected(Table[ProductName]) , 0.72
) , blank())
@EZiamslow , Try like
Target =
Switch( true(),
"ProductA" in allselected(Table[ProductName]) , 0.80,
"ProductB" in allselected(Table[ProductName]) , 0.72,
"ProductC" in allselected(Table[ProductName]) , 0.72
)
Thank you for helping.
That solved the issue of selecting both ProductB and ProductC. (Good)
However, when I select ProductA (80%) and ProductB (72%), the target is showing 80%. How do I make it so it doesn't show any target when selecting different values.
When I select all three, it shows 80%. I don't want to show anything.
@EZiamslow , Try like
Target = if( countrows(allselected(Table[ProductName])) =1 ,
Switch( true(),
"ProductA" in allselected(Table[ProductName]) , 0.80,
"ProductB" in allselected(Table[ProductName]) , 0.72,
"ProductC" in allselected(Table[ProductName]) , 0.72
) , blank())
now, I can only select one ProductName at a time, even for the same target values.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 49 | |
| 35 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 92 | |
| 75 | |
| 41 | |
| 26 | |
| 25 |