Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Card visual with Filter rankx specific

Hi,

 

I am stuck pulling this 43.3 calculation out with a rank filter added into it. Can someone help me put it into a card?

 

43.3

 

 

 

 

 

 

 

 

 

 

 

 

 

Like a filter like this?

,

filter(Tech,[RankX Tech Flat Rate] =1)

 

Here is my Formula that is calculating this number:

 

Calculation

 

 

 

 

  • Anonymous Are you wanting each employee to have ranked goals 1-N by location for the date selected (ie today)??

     

    Is your Tech table a unique table for employee key? 

     

    If you can draw out your desired result with some sample data for about 3 employees over 5 days then I'll understand 100% what you need, but right now I'm still wrapping my head around the requirement. 

     

    You may need to use the KEEPFILTERS() function inside your RANKX, but if your Tech table is an employee table and location and Dates are in separate tables then you may not need that step....

6 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Icon for Community Champion rankCommunity Champion

    Anonymous I don't really know what you're asking yet and you need to provide all the DAX please, including for those measures within measures such as [Gap_value] 

     

    Depending what you want, it could be as simple as: 

     

    Filtered Measure = CALCULATE( [Flat Rate Gap to Budget, WD Daily] , filter(Tech,[RankX Tech Flat Rate] =1) )

     

    Or may be more complex such as using AVERAGEX: 

     

    Filtered Measure = AVERAGEX( filter(Tech,[RankX Tech Flat Rate] =1),  [Flat Rate Gap to Budget, WD Daily]  )

     

    or something else entirely, but need more info on what you're looking for in that case.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Allison,

       

      Thanks for getting back to me. Here is some more information on the problem I am having and trying to solve. I know I am very close to getting what I need, just not sure what I am missing.

       

      I have this calculation that pulls from 3 different tables (Fact Table, Budget table, Dates Table).

       

      Gap to Budget, Daily Calc = divide(([Budget] - [Actuals]),[Working Days Left, MTD],0)

       

      In order to get the employee their goal for the day. I want to Rank the highest goal for the day, by location, and is today.  My Ranking Calculation is:

       
      Rankx By Goal =
      Rankx(
      All(
      Tech[Tech]),
      [Flat Rate Gap to Budget, WD Daily]
      )

       

      I know I probably have to call a virtual table then do a Max or Min Date to call the lastest date for this calculation. Here is my dalily goal Calculation that gives me the latest day in a visual card, but I can't seem to filter by my ranking measure  and have it be dynamic. 

       

      Flat Rate Gap to Budget, WD Daily =
      Var Gap_Table = summarize(Dates,Dates[Date],"Gap_value",[Gap to Budget, Daily Calc])
      Return
      if(HASONEVALUE(Dates[Date]),[Gap to Budget, Daily Calc],MINX(Gap_Table,[Gap_value])
      )

       

       

      Do you think you can help with this part?

       

      Thanks so much,

      Trevor

       

      • AllisonKennedy's avatar
        AllisonKennedy
        Icon for Community Champion rankCommunity Champion

        Anonymous Are you wanting each employee to have ranked goals 1-N by location for the date selected (ie today)??

         

        Is your Tech table a unique table for employee key? 

         

        If you can draw out your desired result with some sample data for about 3 employees over 5 days then I'll understand 100% what you need, but right now I'm still wrapping my head around the requirement. 

         

        You may need to use the KEEPFILTERS() function inside your RANKX, but if your Tech table is an employee table and location and Dates are in separate tables then you may not need that step....