Forum Discussion
Anonymous
7 years agoNot applicable
Word Cloud - Getting Top N Word Frequency
Hello all, I have a table with multiple columns. One of the columns is "action taken." Each row of the column is a sentence. My task is to identify which top words in the actions taken column hav...
- 7 years ago
Hi Anonymous
New a blank query and paste above formula in advanced editor.Then you can check the steps in query editor.Attached sample file.
Regards,
v-cherch-msft
7 years agoMicrosoft Employee
Hi Anonymous
You may use Split,Unpivot columns and group by function to get that.For example:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZY6xDsIwDAV/xcpctRQGBgYkNiQW5qpDSNzKUhOX2OH7SQtDEfvdvdd1pm12bbPftUdTmRsnDECz5ACeJ04gpGADagWOo6BT1JzAeppJHMURcCKtTV/9hq5qnxkXR5MFlOJbB54cKclpxfcb/IJWs5SxB8GL/LqBIgiBE2GUVThshFj4ZAPYYSifytuVnlmWv5/a38i3VcM9M9BIpVABxWem8i6w57Pp+zc=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Date = _t, Text = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Text", type text}}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "Text", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), {"Text.1", "Text.2", "Text.3", "Text.4", "Text.5", "Text.6", "Text.7", "Text.8"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Text.1", type text}, {"Text.2", type text}, {"Text.3", type text}, {"Text.4", type text}, {"Text.5", type text}, {"Text.6", type text}, {"Text.7", type text}, {"Text.8", type text}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type1", {"Date"}, "Attribute", "Value"),
#"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"}),
#"Grouped Rows" = Table.Group(#"Removed Columns", {"Value"}, {{"Count", each Table.RowCount(_), type number}}),
#"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Count", Order.Descending}}),
#"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Rank_TopN", 1, 1)
in
#"Added Index"
Regards,
- Anonymous7 years agoNot applicable
Can you please upload a sample PBIX file where you have done this?
- v-cherch-msft7 years agoMicrosoft Employee
Hi Anonymous
New a blank query and paste above formula in advanced editor.Then you can check the steps in query editor.Attached sample file.
Regards,