Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Sorting in slicer

Hello experts,

 

New to this. I have this dimension which I need to use it in slicer. What is the easiest way to sort it the correct way?

 

 

Thanks,

KR

 

  • Hi,

    In the table from where you have created the slicer, create another column with values in that column as 0,1,2,5,10.  Now use the Sort by column feature to sort the "Time in Job Goup" column by the new column.

    Hope this helps.

2 Replies

  • Hi,

    In the table from where you have created the slicer, create another column with values in that column as 0,1,2,5,10.  Now use the Sort by column feature to sort the "Time in Job Goup" column by the new column.

    Hope this helps.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    I create a sample pbix file(see attachment) for you just as suggested by Ashish_Mathur , please check whether that is what you want.

    1. Add a column to get the first number in Power Query Editor(You can paste the codes below to get it)

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtA1VIhMTSxSitWJVjI00AZziiE8XSMknpGuKRLPVNfQAMaNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Time in Job Group" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Time in Job Group", type text}}),
        #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Time in Job Group", "StartYear"),
        #"Extracted Text Before Delimiter" = Table.TransformColumns(#"Duplicated Column", {{"StartYear", each Text.BeforeDelimiter(_, "-"), type text}}),
        #"Extracted Text Before Delimiter1" = Table.TransformColumns(#"Extracted Text Before Delimiter", {{"StartYear", each Text.BeforeDelimiter(_, "+"), type text}}),
        #"Changed Type1" = Table.TransformColumnTypes(#"Extracted Text Before Delimiter1",{{"StartYear", Int64.Type}})
    in
        #"Changed Type1"

    2. Sort the column [Time in Job Group] by the new column

    Best Regards