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

CONCATENATE EXCEPT BLANK VALUES

Hello everyone,

 

I have the following code, in which I am creating a new column with the purpose of creating combinations of articles according to the sessionId. However, some of the 'Articles' rows are blank and therefore I would like to include in my code the condition to ignore the empty article rows and only make concatenation when values appear. Could anyone please indicate where should I include this part in my code?

Many thanks!!

 

Combinations of Articles = ADDCOLUMNS(VALUES('Table1'[sessionId]), "Combinations of Articles", CALCULATE(CONCATENATEX(VALUES('Table1'[Articles]),'Table1'[Articles], "&")))
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

 

Combinations of Articles = ADDCOLUMNS(VALUES('Table1'[sessionId]), "Combinations of Articles", CALCULATE(CONCATENATEX(VALUES('Table1'[Articles]),'Table1'[Articles], "&"), filter('TABLE1', not(isblank('Table1'[Articles])))))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

thank you!!!

amitchandak
Super User
Super User

@Anonymous , Try like

 

Combinations of Articles = ADDCOLUMNS(VALUES('Table1'[sessionId]), "Combinations of Articles", CALCULATE(CONCATENATEX(VALUES('Table1'[Articles]),'Table1'[Articles], "&"), filter('TABLE1', not(isblank('Table1'[Articles])))))

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.