Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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())
User | Count |
---|---|
75 | |
74 | |
44 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |