Forum Discussion

WG-PBI's avatar
WG-PBI
Frequent Visitor
2 years ago
Solved

Struggling with Ranking

I have a table called 'Sites' with the following columns

OrganisationIDSiteIDDate StartedTime to Start
4104428/06/201838
4104525/04/201210
4104810/01/202440
3109212/08/20220
3109305/02/202450
6905701/03/20236
71008404/09/20237

 

On my report page I have a table visual that contains the following columns:

OrganisationName (from a dimension table that shares OrganisationID)
Average Time to Start (which is the Time to Start column dragged in, and then set to average which is displaying the total average time to start per organisation accurately)

Date Started is on the many side of a *-1 relationship with my date table so that I can filter the page by 'Fiscal Year' which is a column present in the date table.

I am trying to add a column to my table visual that will dynamically rank the rows from lowest to highest total average start up time for each organisation but can't seem to figure this out.

Any help greatly appreciated as always! ðŸ˜€

  • Rank = 
    var a = SUMMARIZE(ALLSELECTED('Table'),[OrganisationID],"R",[Average Time to Start])
    return rankx(a,[Average Time to Start],,ASC)
    
    Average Time to Start = AVERAGE('Table'[Time to Start])

     

     

3 Replies

  • Don't include the Date Started or the Site ID in the visual.

     

     

  • WG-PBI's avatar
    WG-PBI
    Frequent Visitor

    So the end result I am looking for would do this...

    OrganisationIDAverage Time to StartRank
    6 (Big Bill's Buffalo Ranch)6.001
    7 (Tiny Tim's Tiger Emporium)7.002
    3 (Loud Lucy's Lion Zoo)25.003
    4 (Grim Gary's Giraffe Safari)29.334

     

    • lbendlin's avatar
      lbendlin
      Super User

      Rank = 
      var a = SUMMARIZE(ALLSELECTED('Table'),[OrganisationID],"R",[Average Time to Start])
      return rankx(a,[Average Time to Start],,ASC)
      
      Average Time to Start = AVERAGE('Table'[Time to Start])