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
indigodiv
Regular Visitor

How to have a table show a message unless a slicer is selected for data with text values

Hello everyone,

 

I'm new to Power BI and I want to create a table visual that shows "To view notes, please select an area from the area slicer" unless an area from the slicer is selected, in which case it will show the notes. 

 

I have a table of Areas, and a table of Notes that contain comments about visuals in the area. I am attaching screenshots of the data and the relationship between them in power bi here: 

indigodiv_0-1642380802930.png

indigodiv_1-1642380857802.png

indigodiv_2-1642381102204.png

The Areas from the Areas1 table is connected to the Areas in the notes table via a many to 1, single cross filter direction. 

 

In Dax, I created two measures: 

1. Filtered Area = Calculate( Isfiltered (Areas1[Areas]), ALLSELECTED(Areas1[Areas])) 
2. Notes Measure = IF( [Filtered Area] = TRUE, values(Notes[Notes]), "To see notes, please select a Service Area from the Service Area Slicer")
 
I then dragged the Notes Measure into the values field of the table. 
 
When nothing in the slicer is selected, the table appears to work the way I want it to: 
indigodiv_5-1642381608302.png

 

 
However, when I select an area, I get an error instead of the table displaying the notes (screenshot attached below):
indigodiv_4-1642381396334.png

 Why doesn't the dax work and how can I fix it? Thank you!


 

 

 

 

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

Hi, @indigodiv 

Since there are multiple notes in one area, you cannot get the correct return result.
Try to modify the measures as follows:

Notes Measure = 
IF( ISFILTERED(Areas[Area]) = TRUE, CONCATENATEX(values(Notes[Notes]), [Notes],"; "),
    "To see notes, please select a Service Area from the Service Area Slicer")

Result:

vangzhengmsft_0-1642565985140.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

3 REPLIES 3
v-angzheng-msft
Community Support
Community Support

Hi, @indigodiv 

Since there are multiple notes in one area, you cannot get the correct return result.
Try to modify the measures as follows:

Notes Measure = 
IF( ISFILTERED(Areas[Area]) = TRUE, CONCATENATEX(values(Notes[Notes]), [Notes],"; "),
    "To see notes, please select a Service Area from the Service Area Slicer")

Result:

vangzhengmsft_0-1642565985140.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@indigodiv , you have to create measure like

 

if( Isfiltered (Areas1[Areas]), [Measure], blank())

Thank you for your response!! Would this new measure  be in addition to the two other dax measures I wrote? What does this third one do? 

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.

Top Solution Authors