Forum Discussion

info_algoritmia's avatar
3 years ago

How can I dynamically highlight min and max from a table visual

Hey,

 

How can I highlight the max and min value of a table visual and that also these value changes when filters are applied to the table?

 

Imagine you have a table with two columns: Month name and Total sales, What I need is a measure that returns the value of the max value from the current filter context, let's say the our best month this year was June 2023, I want the measure to show June's sales value, but if I apply a filter for product category, and choose let's say "Product A", I'd like to have the max value updated for Product A too, and any other filter that we could apply.

 

Does this make sense? Let me know if you'd require a dataset

4 Replies

  • Hi info_algoritmia 
    You can create measures for minimum and maximum and base them modify conditional formatting.
    something like that:

    To have this functionality I created 3 measures :

    1. Total breakdowns 

    Total breakdowns = sum('Table'[Brakdowns])
    2. For maximum by machine
    max breakdowns = CALCULATE(max ('Table'[Brakdowns]),ALLEXCEPT('Table','Table'[Machine]))
    3. condition for formatting
    condition = if([max breakdowns]=[Total breakdowns],1,0)

    Link to a sample with heat map as a bonus 🙂 

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

    • info_algoritmia's avatar
      info_algoritmia
      Icon for Helper II rankHelper II

      Thanks for the idea Ritaf1983  but what I require is something like this

       

      Just a table visual with dates (it could be weeks, months, etc.) with the Total sales, and the new measure to always return the highest value of sales based on the current data shown in the table, modified by filters too

  • info_algoritmia 

    You should attach PBIX sample file with issue everytime which will help others to understand your query quickly and solve that in your file itself.

     

    As I understand your query: you can follow below steps

    1. Create a measure for MaxSales:

    Max Sales = MAXX(ALLSELECTED(YourTable), YourTable[Total sales])

    2. Create a measure or month name with maxSales

    Max Sales Month =

    VAR MaxSales = [Max Sales]

    RETURN

    CALCULATE( MAX(YourTable[Month name]), FILTER(ALLSELECTED(YourTable), YourTable[Total sales] = MaxSales) )

     

    Now you can use these measures in your report

    • info_algoritmia's avatar
      info_algoritmia
      Icon for Helper II rankHelper II

      Thanks for the idea HKInd  but what I require is something like this

      Just a table visual with dates (it could be weeks, months, etc.) with the Total sales, and the new measure to always return the highest value of sales based on the current data shown in the table, modified by filters too