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
Anonymous
Not applicable

Including Blank/Null Values in Slicer/Filter

Hello,

 

I have 2 tables in my data model: Employess and Projects that has a 1 to many relationship. I was wondering if there is a way to filter null values in my model(ie. the relationship in my data model produces a null value, not a null/blank in my actual datasets).  

 

For example, in the below sample tables, i would like a table with just the Employees table(to exclude duplicates employees rows due to multiple projects they are involved in), but add a slicer to be able to filter projects to see which employees are involved in them.   However, the projects slicer only includes A and B.  I have tried to include the filter Project Category is Blank as well as Project Category is Empty, but am unable to to filter out employees 2 and 6 who are not in the Project Table(note adding the Project Category column and checking off "show items with no data" does allow me ot see them but I would prefer a way in PowerBI to include them without having to export to excel to to the filtering there).  Also, the filters may include multiple project categories(for example, I may want to see employees part of Project A and those that do not have projects in the same list)

 

Thanks in advance for your help!

 

Employees Table

Employee IDEmployee Name
1Bob
2Glen
3Stuart
4Jennifer
5Sheldon
6Kate

 

Projects Table

Employee IDProject Category
1A
3B
4A
4A
5B
5B
2 REPLIES 2
Duia
Resolver II
Resolver II

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create measure.

Flag =
var _select=SELECTEDVALUE('Projects Table'[Project Category])
var _123=
SELECTCOLUMNS(
FILTER('Projects Table','Projects Table'[Project Category] = _select),"1",'Projects Table'[Employee ID])
return
IF(
    MAX('Employees Table'[Employee ID]) in _123,1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

Duia_0-1660206250921.png

3. Result:

Duia_1-1660206250923.png

 

Best Regards,

Liu Yang

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

MahyarTF
Memorable Member
Memorable Member

Hi,

Please watch the below video :
https://www.youtube.com/watch?v=pEAwvMkpA8I

 

Mahyartf

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.