Forum Discussion
Create Counter for Each Value in a Specific Columns as New Columns
- Anonymous7 years ago
This was cool,
You should to pivot the Category column.
This is the new script:let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDVNzDXNzIwNFfSUXJOLElNzy+qNFSK1QFKmZEmZQSRMkeSwhRBM8cCi5QxRMoS3RxDA5zmYJUywi0FtCIWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Date = _t, Categories = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Categories", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","","""Null""",Replacer.ReplaceValue,{"Categories"}),
#"Duplicated Column" = Table.DuplicateColumn(#"Replaced Value", "Categories", "Categories - Copy"),
#"Pivoted Column" = Table.Pivot(#"Duplicated Column", List.Distinct(#"Duplicated Column"[#"Categories - Copy"]), "Categories - Copy", "Categories", List.Count)
in
#"Pivoted Column"I deserve a big congratulation, so I congratulate myself ... Well done ...; D
Hi leandromaiaf,
It's quite simple. See the image I've attached.
Tell us if works for you.
- Anonymous7 years agoNot applicable
Thanks for you help!
Yes, thats exactly what I need, but is it possible to manipulate it in query editor?
Or maybe create a new table in the report itself?
- BobBI7 years ago
Resolver III
i created 2 duplicate entries to show the result. Create a summary table and use it to create visual.
SUMMARIZE(categories, categories[Date], categories[Categories], "Count",count(categories[Date]) )Hope this helps,
SS
- Anonymous7 years agoNot applicable
Thanks BobBI.
I need to get it in separate columns because I want them to composte an cumulative line chart, in order to access specific category by filtering, I think your solution could not accomplish that.
Is there anyway to break it in columns?
- Anonymous7 years agoNot applicable
Sure. Otherwise, I would not have been able to create the table.
- Anonymous7 years agoNot applicable
Yeah, I mean by using DAX or M languages. The way you created I cannot graph it. Do you understand my point?