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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jfla
New Member

dealing with blanks in DAX

I  have 2 tables (actuals and budgets) that each include a WBS#, but some of the budget rows can be blank. Actuals always have it. 

I'm trying to create a new table of all the unique WBS# across both tables. 

when all rows in these table have a WBS#, this DAX works:

WBS_DIM = DISTINCT (UNION(DISTINCT(ERP[WBS_ERP]), (DISTINCT(Table_Tasks[WBS])) ))

 

but when the Table_Tasks includes blanks, then I get an error.  I have tried the DAX below but

WBS_DIM = FILTER (
DISTINCT (
UNION(
DISTINCT(ERP[WBS_ERP]),
DISTINCT(Table_Tasks[WBS])
)
),
NOT ISBLANK (Table_Tasks[WBS])
)

I get an error that states "A single value for column 'WBS' in table 'Table_Tasks' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as"

 

I'm new to dax (but used to write SQL).  any help would be great!

thanks - 

j

1 ACCEPTED SOLUTION
jfla
New Member

I tried this, and it  worked:

 

WBS_DIM = FILTER (
                DISTINCT (
                    UNION(
                        TOPN ( 0, ROW ("New_WBS", "asdf" ) ),
DISTINCT(erp[wbs_erp]),
                        DISTINCT(Table_Tasks[WBS])
                    )
                ),
            [New_WBS] <> BLANK ()
            )

View solution in original post

4 REPLIES 4
jfla
New Member

I tried this, and it  worked:

 

WBS_DIM = FILTER (
                DISTINCT (
                    UNION(
                        TOPN ( 0, ROW ("New_WBS", "asdf" ) ),
DISTINCT(erp[wbs_erp]),
                        DISTINCT(Table_Tasks[WBS])
                    )
                ),
            [New_WBS] <> BLANK ()
            )
tamerj1
Super User
Super User

Hi @jfla 

I think the problem is that the columns have different names. Try store them in variables as follows

A6CFF686-8CE9-4C6C-83D6-773386E66310.jpeg

or if youneed to remove all blanks use

937A0BC7-ED44-4F77-8B49-91AD94BCFB1C.jpeg

Hi!  thanks.  I used the second option, but now it get 

"The ALLNOBLANKROW function expects a table reference for argument '1', but a table expression was used."

I checked my syntax multiple  times and it looks correct. 

Hi:

I know tamerj1 has been working with you, so I hope not to step on toes. Anyways maybe:

 

DISTINCT(

       UNION(

         ALLNONBL:ANKROW(ERP[WBS_ERP]), 

         ALLNONBLANKROW(Table_Tasks[WBS])

)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.