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
gittelena
Employee
Employee

Slicer based on relationships - how to change name of the option called (blank)

Hi there,

Hope you can help me understand how to change name of the option called "(blank)" in my slicer (and chart) - see picture below.

 

Capture.PNG

 

Here is some background:

  •  I want to show - and be able to filter on - how many of the customers from my master query are preferred customers.  
  •  My slicer and chart pulls in data from 2 different queries. I have connected the two via a relationship (cardinality = "Many to one", cross filter direction = "Single")
  •  My master query contains a list of customers and a unique customer id. My other query contains a list of customers who are preferred customers and their unique customer id. I have connected these two queries with the unique customer id.
  •  My slicer and chart now shows those that are on the list by showing the field "Yes" (which is a column in the preferred customer query, but then for those that it cannot match it shows "(Blank)". Is way I can change the name from "(Blank)" to e.g. "No"?

Thanks!

GL

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

Hi @gittelena 

I think you build two tables as below, build relationships(Many to one & Single) between Unique ID columns between two tables and build a slicer by On preferred list? column.

Customer Table:

2.png

Preferred customers Table:

1.png

Relationship:

3.png

Due to On preferred column don't have "NO"Values and two tables are related, so the slicer will show blank as "No".

4.png

You can achieve your goal by calculated column or measure. And you don't build relationships or add an On preferred column in Preferred customer Table.

Measure:

Build a Yes/No slicer.

5.png

 

M_Customer = 
VAR _Select =
    SELECTEDVALUE ( Slicer[On Preferred List?] )
VAR _PreferTable =
    VALUES ( 'Preferred customers'[Customer] )
VAR _Yes =
    CALCULATE (
        MAX ( Customer[Customer] ),
        FILTER ( Customer, Customer[Customer] IN _PreferTable )
    )
VAR _No =
    CALCULATE (
        MAX ( Customer[Customer] ),
        FILTER ( Customer, NOT ( Customer[Customer] IN _PreferTable ) )
    )
RETURN
    IF (
        ISFILTERED ( Slicer[On Preferred List?] ),
        IF ( _Select = "Yes", _Yes, _No ),
        MAX(Customer[Customer])
    )

 

Result is as below.

Default:

6.png

Select Yes/No in Slicer.

7.png

Or you don't need to do anything except building a calculated column in Customer table.

 

On Preferred list? = IF(Customer[Customer]in VALUES('Preferred customers'[Customer]),"Yes","No")

 

Result is the same as above.

You can download the pbix file from this link: Slicer based on relationships - how to change name of the option called (blank)

 

Best Regards,

Rico Zhou

 

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-rzhou-msft
Community Support
Community Support

Hi @gittelena 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

v-rzhou-msft
Community Support
Community Support

Hi @gittelena 

I think you build two tables as below, build relationships(Many to one & Single) between Unique ID columns between two tables and build a slicer by On preferred list? column.

Customer Table:

2.png

Preferred customers Table:

1.png

Relationship:

3.png

Due to On preferred column don't have "NO"Values and two tables are related, so the slicer will show blank as "No".

4.png

You can achieve your goal by calculated column or measure. And you don't build relationships or add an On preferred column in Preferred customer Table.

Measure:

Build a Yes/No slicer.

5.png

 

M_Customer = 
VAR _Select =
    SELECTEDVALUE ( Slicer[On Preferred List?] )
VAR _PreferTable =
    VALUES ( 'Preferred customers'[Customer] )
VAR _Yes =
    CALCULATE (
        MAX ( Customer[Customer] ),
        FILTER ( Customer, Customer[Customer] IN _PreferTable )
    )
VAR _No =
    CALCULATE (
        MAX ( Customer[Customer] ),
        FILTER ( Customer, NOT ( Customer[Customer] IN _PreferTable ) )
    )
RETURN
    IF (
        ISFILTERED ( Slicer[On Preferred List?] ),
        IF ( _Select = "Yes", _Yes, _No ),
        MAX(Customer[Customer])
    )

 

Result is as below.

Default:

6.png

Select Yes/No in Slicer.

7.png

Or you don't need to do anything except building a calculated column in Customer table.

 

On Preferred list? = IF(Customer[Customer]in VALUES('Preferred customers'[Customer]),"Yes","No")

 

Result is the same as above.

You can download the pbix file from this link: Slicer based on relationships - how to change name of the option called (blank)

 

Best Regards,

Rico Zhou

 

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

@gittelena ,Can you share sample data and sample output in table format?

 

is this a calculated column then you should change the calculation to return No too.

new column

if(isblank([is no preferred list]),"No","Yes")

AlexisOlson
Super User
Super User

As far as I know, you can't change the name of (Blank).

 

The key here is that you need to categorize all of the customers whether they are on the preferred list or not. One way to do this would be to create a calculated/custom column on your master customer table that returns "Yes" for anyone on the preferred table and "No" otherwise. There are a variety of ways to do this but I'd recommend doing it in the query editor so you don't need to load both tables to your model.

 

 

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.