The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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())