Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi all,
I am stuck with a challenge in Power Query, which should not be very difficult to solve, but i haven't found the solution yet.
I have a table that links activities to persons. An activity can be linked to one or more persons, a person can be linked to one ore more activities. Every row contains one activity and one person, so if an activity has more than one person, there will be more rows for that activity.
I want to transform the table to a table that hase unique activity ID's and a column that contains all persons linked to that activity.
I have summarized the table on Activity ID (see below), but how do I get the multiple values into one column of the table?
summarized by activity ID
Result should look like this for selected row
Solved! Go to Solution.
You can group on ACTIVITYID, choose some dummy operation for FULLNAME (e.g. Max, not "All Rows") and then adjust the generated code to combine the names:
let Source = #table(type table[ACTIVITYID = number, FULLNAME = text],{{1, "Pietje Puk"},{2, "Maarten de Ruijter"},{2, "Sjaak van den Hoek"}}), #"Grouped Rows" = Table.Group(Source, {"ACTIVITYID"}, {{"Persons", each Text.Combine([FULLNAME], ", "), type text}}) in #"Grouped Rows"
The previous reply beat me to it!!
You can group on ACTIVITYID, choose some dummy operation for FULLNAME (e.g. Max, not "All Rows") and then adjust the generated code to combine the names:
let Source = #table(type table[ACTIVITYID = number, FULLNAME = text],{{1, "Pietje Puk"},{2, "Maarten de Ruijter"},{2, "Sjaak van den Hoek"}}), #"Grouped Rows" = Table.Group(Source, {"ACTIVITYID"}, {{"Persons", each Text.Combine([FULLNAME], ", "), type text}}) in #"Grouped Rows"
Thank you
Thanks, this does the job!
Can you please explain How you did this? I have same requirement where I have same month in different rows and want to combine data of same month in one row. I am still in learning phase of Power BI so a detailed explanation will be very helpful.
Thanks:)
Hi,
You need to group on "Month" and then use each Text.Combine statement like the example earlier in this thread. Text.Combine can not be chosen in the user interface, so you need to enter the code in the advanced query editor OR choose on of the options you can choose from the user interface (like minimum or maximum) and change the code in the advanced editor.
If this doesnt help, send me an example (or screenshot) so i can see how your table looks like. In that case i can try to create the code for you.
Have fun!
So here is the screen shot of my Table. I understand when we need to select Column and then click on Grouping. Do I need to enable any settings while writing this query?
As you see in screen shot I need to have my Planned month grouping done and have a column with rows on different Month and summarize the Initial FC value in one row for each month. I know I am asking very basic question and hopefully If i get a detailed steps from you, I will be more comfortable in handling the queries moving forward.. Thanks for being my Tutor.
Hi,
I understand your goal is to summarize the FC column by month. This can be done in PowerQuery, but I would prefer to create a measure in DAX, because a measure would provide a more dynamic way to get summarized data based on filter context. If you do decide to do it in Power Query, you should take the next steps:
Select Date Column
Hit Group By, select Basic and enter a name for the summary column (for example FC Month)
Operation: choose Sum
Column: choose FC (the column for which you want to sum the values)
It should look like this:
Hit OK and your output looks like this:
When you take a look at the advanced query editor, the code you created looks like this:
#"Grouped Rows" = Table.Group(#"Changed Type", {"Planned Date"}, {{"FC Month", each List.Sum([Initial FC]), type number}})
I hope this is helpful
Theo
Hi Theo,
Yes it was helpful but it seems I am not going to leave you soon.:) ..When I tried to do the same I am able to create a new Table alltogether.
Now, I have other fields as well where I would like to do the grouping for examplesee in my below table, I have Planned Date and Actual Date column, I would like to have Planned Date grouping done by Initial FC and Actual Date grouping done by YTD. I want this to be in a Same table so that I can plot a graph with Month and YTD and FC.
Hope I am now clear on what I am trying to achieve and you will be able to guide me in right direction. I am there but not sure how to keep it in one table everything. Thanks for being helpful.
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 |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
42 |