Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all!
I have a Sales Master table that contains for each order 1 row:
Order Nr | Value |
1 | 5 |
2 | 6 |
Then I have a transaction table with multiple rows for each sales order:
Order Nr | Text |
1 | ABC |
1 | ABC |
1 | ADF |
1 | KIG |
2 | B |
Now I would like to add a calculated column to the sales master that contains all distinct text entries for each order from the second table, seperated with a commata.
How is this possible?
Solved! Go to Solution.
You are right. Please try
NewColumn =
CONCATENATEX (
CALCULATETABLE ( VALUES ( transaction[Text] ) ),
transaction[Text],
UNICHAR ( 10 ),
transaction[Text], ASC
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @joshua1990
assume that you have a one to many relationship between the two tables based on [Prder Nr] columns then
NewColumn =
CONCATENATEX (
RELATEDTABLE ( transaction ),
transaction[Text],
UNICHAR ( 10 ),
transaction[Text], ASC
)
@tamerj1 : Thanks a lot! Yes, there is a 1:n relation between both tables.
It works, but not in the way I would like to see. I get as a string all values now, but I would like to get just distinct / unique values. How can I exclude duplictes here?
You are right. Please try
NewColumn =
CONCATENATEX (
CALCULATETABLE ( VALUES ( transaction[Text] ) ),
transaction[Text],
UNICHAR ( 10 ),
transaction[Text], ASC
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |