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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MAJackson
Frequent Visitor

IF statement to show one value or blank - HELP

Hello,

 

I am creating a dashboard that shows a list of items on the left.   When an item is selected (filtered to 1) I would like the data to be displayed on the right.  I have mulitple fields and by default I would like everything blank until a single item is selected from the table. 

 

Is there a way to have a visual blank "  " until a single item is selected?

 

I tried the following if statement but am getting an error:

 View Company = IF(DISTINCTCOUNT (Engagements[Company]) = 1, Engagements [Company], "   ")

 

The text in red is not able to associate with the table/column I need.  When I enter text into that spot the formula works.  It reads the table/column correct in the distinct count section but not the if value is true display company  section.

 

Any help would be greatly appreciated. 

 

 

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @MAJackson ,

 

We can try to create a measure to meet your requirement:

 

Measure = IF(HASONEVALUE(Engagements[Company]),VALUES(Engagements[Company]),BLANK())

 

9.jpg10.jpg

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lid-msft
Community Support
Community Support

Hi @MAJackson ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @MAJackson ,

 

We can try to create a measure to meet your requirement:

 

Measure = IF(HASONEVALUE(Engagements[Company]),VALUES(Engagements[Company]),BLANK())

 

9.jpg10.jpg

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Tahreem24
Super User
Super User

You can use below accepted solution using below link:
https://community.powerbi.com/t5/Desktop/Text-field-to-show-the-selected-filter/td-p/251023

Don't forget to give thumbs up 👍and accept this as a solution if this helps you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Tahreem24
Super User
Super User

You can use isfiltered DAX function.
https://docs.microsoft.com/en-us/dax/isfiltered-function-dax

Don't forget to give thumbs up 👍and accept this as a solution if this helps you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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