Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PBI_newuser
Post Prodigy
Post Prodigy

How to show blank when no selected value on slicer

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()))

PBI_newuser_0-1630470179241.png

 

1 ACCEPTED SOLUTION
mussaenda
Super User
Super User

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())

View solution in original post

1 REPLY 1
mussaenda
Super User
Super User

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())

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.