Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I am not so familiar with M lang, and am straggling to solve the following problem in Power Query:
I have the table
TABLE1
| Date | Attribute | Value |
| 2023-02-01 | AA | A1 |
| 2023-02-01 | AA | A2 |
| 2023-02-01 | BB | B1 |
| 2023-02-02 | AA | A3 |
| 2023-02-03 | BB | B2 |
| 2023-02-03 | BB | B3 |
| 2023-02-04 | CC | C1 |
| 2023-02-06 | AA | A4 |
I need to combine (with ";" as separator) values in cells indicated above in italic so the only one row exist for every Date/Attribute combination.
In other words, the desired table should looks like this:
| Date | Attribute | Value |
| 2023-02-01 | AA | A1; A2 |
| 2023-02-01 | BB | B1 |
| 2023-02-02 | AA | A3 |
| 2023-02-03 | BB | B2; B3 |
| 2023-02-04 | CC | C1 |
| 2023-02-06 | AA | A4 |
Please help!
Solved! Go to Solution.
Hi,
You have to group by
then add a custom column
Table.ToList( Table.RemoveColumns([Count],{"Date", "Attribute"}))
then extract values
select your delimiter
and remove column count
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!
Thank you very much, @serpiva64 !!!
It turns much easier then I've tried to code with nested M functions.
Thanks once again for very helpful reply.
Hi,
You have to group by
then add a custom column
Table.ToList( Table.RemoveColumns([Count],{"Date", "Attribute"}))
then extract values
select your delimiter
and remove column count
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |