March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello everyone,
I need help with a dax formula on power bi.
I have two tables, one with item names (table1 on the exemple), another table with the same item names but with also descriptions in the same boxes (table2).
I'm trying to create another table allowing me to have a column with the names of the items and another with each word of the description (table_final).
I need exactly one line per description word (on the exemple, Items5 have 2 description word and Items1 3).
The second table can also have the same ITEMS several times (on the exemple, Items2 is here twice).
Picture : (table1)
Picture : (table2)
Picture : (Final table)
Thank you in advance for your help.
Solved! Go to Solution.
@Dacta - This is best done in Power Query. I would take the following steps:
1) Merge table 1 into table 2 and expand the Items column.
2) Use "Split by delimiter" on the words column of table 2. Set to split by every occurance of the space delimiter
3) select your new columns in this table (the ones created by the last 2 steps) and then "Unpivot Other Columns".
4) remove any unecessary columns (which is likely to be the "attribute" column)
I'm fairly sure this will give you the output you are looking for,
If this helps, please accept as the solution. it helps with visibility for others with the same challenge.
Thanks you everyone for your help!
However, I really need to achieve this function on DAX. This is a request from my company.
For the moment I managed to get a result with this in DAX:
Thanks you everyone for your help!
However, I really need to achieve this function on DAX. This is a request from my company.
For the moment I managed to get a result with this in DAX:
@Dacta - If your solution works, great. But you should be aware that your company has requested you do something in the least efficient way. The DAX approach will be worse for your data model, because the compression of a calculated table is not as great as the compression of a table in Power Query. This will result in a larger data model and a longer refresh of the data.
If you wish to do things with best practice, you should tell your company that it's better to do it the way I and @v-zhengdxu-msft have suggested.
Hi @Dacta
Please try this:
First of all, splite the table2 by delimiter in the power query:
Then in the Table1, click merge queries:
Expand the table:
Select these expanded columns and click unpivot columns
Remove the Attribute column:
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-zhengdxu-msft - Thank you for repeating the steps in my solution but with screenshots.
@Dacta - This is best done in Power Query. I would take the following steps:
1) Merge table 1 into table 2 and expand the Items column.
2) Use "Split by delimiter" on the words column of table 2. Set to split by every occurance of the space delimiter
3) select your new columns in this table (the ones created by the last 2 steps) and then "Unpivot Other Columns".
4) remove any unecessary columns (which is likely to be the "attribute" column)
I'm fairly sure this will give you the output you are looking for,
If this helps, please accept as the solution. it helps with visibility for others with the same challenge.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
19 | |
16 | |
9 | |
5 |
User | Count |
---|---|
36 | |
29 | |
16 | |
15 | |
12 |