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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi, I have 3 products which is Product A, B and C. But only Product A and Product C have target value.
Product A = 26
Product C = 30
I would like to show the target line when Product A or C is selected but show no line when there is no selection on Product slicer.
How to do that? The below measure doesn't work.
Target =
IF(SELECTEDVALUE('Table'[Product])="A",26,
IF(SELECTEDVALUE('Table'[Product])="B",30,BLANK()))
Solved! Go to Solution.
Hi @PBI_newuser ,
Try Hasonvalue outside of selectedvalue.
Like
Target =
IF(HASONVALUE('Table'[Product]),
IF(SELECTEDVALUE('Table'[Product])="A",26,
IF(SELECTEDVALUE('Table'[Product])="B",30,BLANK())),BLANK())
Hi @PBI_newuser ,
Try Hasonvalue outside of selectedvalue.
Like
Target =
IF(HASONVALUE('Table'[Product]),
IF(SELECTEDVALUE('Table'[Product])="A",26,
IF(SELECTEDVALUE('Table'[Product])="B",30,BLANK())),BLANK())