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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ms_flxx
New Member

Always select Blank in the Filter combined with Cross Filtering

Hello all together! 

 

My following question is based on this post here: Always select Blank in the Filter. Unfortunately, it does not fully cover my problem. My minimum working example is based on this for better comparability and understanding. Since I am still new to the forum here, I hope it is correct to create a new issue...

 

But now to my concern:

 

Main Question 

I would like to cross-filter my table so that a selected option in the slicer also includes all blank values (i.e. and-condition).

 

Detailled Description 

I have a table called 'Table' that contains the columns 'Year', 'Season' and 'Value':

 

ms_flxx_0-1712657387528.png

 

As you can see, the columns 'Year' and 'Season' contains both, data as well as nulls. I would like to filter this table by 'Year' and 'Season' using two different slicers. Therefore I created two seperated Tables called 'Seasons' and 'Years', that only contain the respective columns 'Year' resp. 'Season':

 

ms_flxx_1-1712657778332.pngms_flxx_2-1712657791562.png 

To ensure that all blanks are selected in addition to the selected option in the slicer, I have adopted the measure from Always select Blank in the Filter

 

 

Season_Measure = IF(SELECTEDVALUE('Table'[Season]) in ALLSELECTED(Seasons[Season]) || SELECTEDVALUE('Table'[Season])=BLANK(),1,0)
Year_Measure = IF(SELECTEDVALUE('Table'[Year]) in ALLSELECTED(Years[Year]) || SELECTEDVALUE('Table'[Year])=BLANK(),1,0)

 

 

If there is no relationship between the tables, everything works as expected:

ms_flxx_3-1712658304589.pngms_flxx_4-1712658321078.png

BUT: If I select the year 2021 as shown in the screenshot, then I only want the seasons that exist for this year to be displayed in the season slicer (in this case only Spring, Winter and Fall). However, if I create a relationship between the tables, the measure no longer works, which also shows me the blanks.

 

I very much hope that I have described my problem sufficiently and concisely. I am very happy to receive help!

Best regards, Felix

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

Hi @ms_flxx 

 

You can add a table like below. Then use these two columns in the slicers. Modify the measures to reference this new table's columns. 

vjingzhanmsft_0-1712727691254.png

vjingzhanmsft_3-1712728378496.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

1 REPLY 1
v-jingzhan-msft
Community Support
Community Support

Hi @ms_flxx 

 

You can add a table like below. Then use these two columns in the slicers. Modify the measures to reference this new table's columns. 

vjingzhanmsft_0-1712727691254.png

vjingzhanmsft_3-1712728378496.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.