Forum Discussion

denisdav's avatar
denisdav
Frequent Visitor
10 years ago
Solved

Help to add Custom Visual in PowerBI Desktop

Hi All,   I need help, how to sort the visual (for eg. I want the online in the bottom and offline in the top)?   Thank you.    
  • Twan's avatar
    10 years ago

    Right now your [Device Status] column is being sorted alphabetically which is why Offline is on the bottom and Online is on top of the stacked column chart.  To reverse the order of these you need to add another column to the table that has [Device Status] that can be used to change the sort order of [Device Status].  Add a column in the edit queries step that is 1 whenever [Device Status] = "Online" and 2 the rest of the time.  In the Home ribbon go to Edit Queries -> Add Column - > Add Custom Column.  The Add Column Step would look like this:

    = if [Status] = "Online" then 1 else 2

    Then Close & Apply the changes.  Now go to the data view -> select the status column -> Modeling ribbon -> Sorty By Column -> chose to sort by the new column that was added.

     

    Now the visual should have Online on the bottom of the chart and Offline on top.

     

    -Anthony