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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
arelf27
Helper II
Helper II

DAX - ConcatenateX Function - Check if there's value first and/or value is null and/or blank...

I have the following code that works (VAR X = CONCATENATEX(Table, Table[Column] & " - " & Table[Column], "; ", [Table Column], DESC)   ---however sometimes my result looks like this:

Ex. 1: Client ABC - 0; -; or

Ex. 2: -;

 

Basically it tries to concatenate data from one column (description) based off of the id from another column (id) - but while it matches on the id the description column is blank... So I get the ugly -; without anything following it.. So how can I check first whether there's an actual value before attempting to concatenate.. I'm new to DAX so don't know the syntax at all.

 

Thanks,

 

I simply want to check if current row Table[Column] is blank, null, etc. before doing this step: Table[Column] & " - " & Table[Column], "; ", [Table Column].... Need syntax...

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee


@arelf27 wrote:

I have the following code that works (VAR X = CONCATENATEX(Table, Table[Column] & " - " & Table[Column], "; ", [Table Column], DESC)   ---however sometimes my result looks like this:

Ex. 1: Client ABC - 0; -; or

Ex. 2: -;

 

Basically it tries to concatenate data from one column (description) based off of the id from another column (id) - but while it matches on the id the description column is blank... So I get the ugly -; without anything following it.. So how can I check first whether there's an actual value before attempting to concatenate.. I'm new to DAX so don't know the syntax at all.

 

Thanks,

 

I simply want to check if current row Table[Column] is blank, null, etc. before doing this step: Table[Column] & " - " & Table[Column], "; ", [Table Column].... Need syntax...


@arelf27

Try to apply a filter to the table.

New_Measure =
CONCATENATEX (
    FILTER ( 'Table', 'Table'[description] <> BLANK () && 'Table'[id] <> BLANK () ),
    'Table'[description] & "-"
        & 'Table'[id],
    ";",
    'Table'[description], ASC
)

Capture.PNG

View solution in original post

3 REPLIES 3
Eric_Zhang
Microsoft Employee
Microsoft Employee


@arelf27 wrote:

I have the following code that works (VAR X = CONCATENATEX(Table, Table[Column] & " - " & Table[Column], "; ", [Table Column], DESC)   ---however sometimes my result looks like this:

Ex. 1: Client ABC - 0; -; or

Ex. 2: -;

 

Basically it tries to concatenate data from one column (description) based off of the id from another column (id) - but while it matches on the id the description column is blank... So I get the ugly -; without anything following it.. So how can I check first whether there's an actual value before attempting to concatenate.. I'm new to DAX so don't know the syntax at all.

 

Thanks,

 

I simply want to check if current row Table[Column] is blank, null, etc. before doing this step: Table[Column] & " - " & Table[Column], "; ", [Table Column].... Need syntax...


@arelf27

Try to apply a filter to the table.

New_Measure =
CONCATENATEX (
    FILTER ( 'Table', 'Table'[description] <> BLANK () && 'Table'[id] <> BLANK () ),
    'Table'[description] & "-"
        & 'Table'[id],
    ";",
    'Table'[description], ASC
)

Capture.PNG

Anonymous
Not applicable

Thanks, this is exactly what I needed.

Thanks using Filter did the trick!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.