Forum Discussion

Jmccoy's avatar
Jmccoy
Helper II
5 years ago
Solved

Show Top Value

Have a simple problem I cannot seem to find the best solution for. I have a simple table with four columns, Date, Line, Efficiency, and Goal. See snip attached

I would like to provide a card that will show only the top line for the specified time period. In this case the card would show L6. 

  • Jmccoy try this measure

     

    Measure 2 = 
    CALCULATE ( 
    MAX ( Table[Line] ), 
    TOPN ( 1, ALL ( Table[Line] ), CALCULATE ( MAX ( Table[Efficiency] ) ), DESC ) 
    )

     

    Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

6 Replies

  • Jmccoy try this measure

     

    Measure 2 = 
    CALCULATE ( 
    MAX ( Table[Line] ), 
    TOPN ( 1, ALL ( Table[Line] ), CALCULATE ( MAX ( Table[Efficiency] ) ), DESC ) 
    )

     

    Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

    • Jmccoy's avatar
      Jmccoy
      Helper II

      Excellent, thank you for the response. I noticed with this solution I do not have the ability to use filters. Say I wanted to remove a value from  the Line column to not be used in this calculation. How would I go about doing that? 

    • Jmccoy's avatar
      Jmccoy
      Helper II

      One more question. Currently when I filter the card that is using the measure we created by date, I get the line with the greatest value in that date range. This works great for that card, I could just see the user wanting this other option as well. How could I change this to pick up the average on all days combined for the given period. See image below, I believe that will help you understand my scenario.