Forum Discussion
How to count multiple values in a cell
- Nov 18, 2019
Ugarte335 I used Powerquery to massage your data as you can see in the attached file. From the green table it'll be easy to create your pivottable report. You can also feed the result of the query into the pivottable directly without using the intermediate green table of course.
Thank you, this was much easier than I expected!
Just for the collection, here is a bit another version of query, resulting table is in brown.
- Ugarte335Nov 19, 2019Copper Contributor
Thank you so much for your helpSergeiBaklan
However, I tried with the data downloaded from the provider and it does not recognise it as new line for some reason. The delimiter with the data I provided first was a new line and it was recognised by power query.
Now it doesn't. I have attached the spreadsheet for your convenience.
Thanks
- SergeiBaklanNov 19, 2019Diamond Contributor
It works with your file, please checked attached. I converted the data into the table to simplify, by that doesn't matter. You may use range or query sheet from another file.
Generated script is
let Source = Excel.CurrentWorkbook(){[Name="tblNames"]}[Content], #"Added Custom" = Table.AddColumn( Source, "Name", each Text.Split([Names],"#(lf)") ), #"Expanded Custom" = Table.ExpandListColumn( #"Added Custom", "Name" ), #"Removed Other Columns" = Table.SelectColumns( #"Expanded Custom", {"Country", "Name"} ) in #"Removed Other Columns"