Forum Discussion
jcastr02
6 years agoPost Prodigy
Show Most recent comments
I have a list of comments that I would like to display from most recent to oldest. In my query I have a completion time. However, some of the comment field at times will be blank and may have repea...
- 6 years ago
Hi jcastr02 ,
That is not possible on the table visual as a workaround you can:
- Create a button with no backgroud and no line
- Make the button the size of the column header and place it on top of the header
- Group the table with the header
That way you will still see the header of the table but if you click on it won't be reorder.
smpa01
6 years agoCommunity Champion
I assumed a dataset
| Column1 | Column2 |
| same value | 1/1/2020 10:20:00 AM |
| same value | 1/1/2020 10:45:00 AM |
| same value | 1/1/2020 11:00:00 AM |
| different value | 1/1/2020 10:00:00 AM |
you can do this and display only the 1s from Index column
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKk7MTVUoS8wpTVXSUTLUN9Q3MjAyUDA0sDIyUIrVwSNvYopP3tDKAKIfKAqmUzLT0lKLUvNKsBoGUhwLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type datetime}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"ad", each _, type table [Column1=text, Column2=datetime]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each let
X = [ad],
Y = Table.Sort(X,{{"Column2", Order.Descending}}),
Z = Table.AddIndexColumn(Y, "Index", 1, 1)
in Z),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"Column1", "Column2", "Index"}, {"Column1", "Column2", "Index"})
in
#"Expanded Custom"
if you prefer DAX, a rank column might work
Column = RANKX(FILTER('Table (3)',EARLIER('Table (3)'[Column1])='Table (3)'[Column1]),'Table (3)'[Column2],,ASC)