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

How to restrict blank values in a UNION DAX

Below is my table formula,

NewTable =
UNION (
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_1],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "1"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_2],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "2"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_3],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "3"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_4],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "4"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_5],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "5"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_6],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "6"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_7],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "7"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_8],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "8"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_9],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "9"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_10],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "10"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_11],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "11"
),
SELECTCOLUMNS (
'Staffing Report',
"Manager", 'Staffing Report'[Level_12],
"NT_UserName", 'Staffing Report'[NT_Username],
"Level", "12"
)
)
I want to restrict to only if the manager value is not blank, then fetch the record on each level. How to achieve this?
Thanks
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , On quick solution came to my mind is

Table = filter (Union(<Your code>), not(isblank([Manager])))

 

Or you need that as output from this table ?

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , On quick solution came to my mind is

Table = filter (Union(<Your code>), not(isblank([Manager])))

 

Or you need that as output from this table ?

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

 

Anonymous
Not applicable

I am going to try this one first, looks like it will solve my issue. Thanks

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.