cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zyc
Helper I
Helper I

DAX: FILTER and CONCATENATE UNIQUE values

 

I am trying to FILTER/LOOKUPVALUE and CONCATENATE the relevant UNIQUE values but right now, I am unable to get it to work. I can only do it without the values being UNIQUE.

My current DAX formula:
CONCATENATEX (
FILTER (
ALL ( Table2 ),
Table2[Column1] = Table1[Column1]
),
Table2[Column2],
", "
)

The output from here goes like:
Value1, Value2, Value2

My desired output is: (without any of the values being duplicated)
Value1, Value2
1 ACCEPTED SOLUTION

@zyc , Assuming this is a new column, I tried the same on my data, a new column. without all

Column = CONCATENATEX(summarize(FILTER(Sales,Sales[Item ID] = 'Item'[Item Id]), Sales[City Id]),[City Id], ",")

 

amitchandak_0-1641470019112.png

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

View solution in original post

5 REPLIES 5
smpa01
Super User
Super User

@zyc  provide sample data and expected output to accelerate response





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






New Animated Dashboard: Sales Calendar


amitchandak
Super User
Super User

@zyc , try like

 

CONCATENATEX (
summarize(FILTER (
ALL ( Table2 ),
Table2[Column1] = cvShipments[Column1]
),
Table2[Column2]),
", "
)

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

@amitchandak Hi there, thanks for commenting. I tried but the output that I've obtained is "," and ", ,"

Seems like only commas are being concatenated here...

@zyc , Assuming this is a new column, I tried the same on my data, a new column. without all

Column = CONCATENATEX(summarize(FILTER(Sales,Sales[Item ID] = 'Item'[Item Id]), Sales[City Id]),[City Id], ",")

 

amitchandak_0-1641470019112.png

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

@amitchandak This works great, thanks. Think in the first comment you provided, there was a missing Table2[Column2] as part of the CONCATENATEX formula, hence the error. 

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!