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.

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!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!