Forum Discussion

NicolPuglia's avatar
NicolPuglia
Frequent Visitor
6 years ago
Solved

Table formatting conditions

Hi,

 

I have a table widget and I would like the first 100 values to be colored according to the filter put.

 

With formatting conditions I can't.

 

Can you help me?

 

Thank you very much indeed!

 

Nicola

  • Hi NicolPuglia ,

    We can use the following steps to meet your requirement.

     

    1. Create a measure to calculate the value of rows.

     

    Measure = 
    var x = MAX('Table'[date])
    return
    CALCULATE(DISTINCTCOUNT('Table'[date]),FILTER(ALLSELECTED('Table'),'Table'[date]<=x))

     

    2. Then we can configure the Total measure’s conditional formatting using [Measure].

     

     

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?

    BTW, pbix as attached.

     

    Best regards,

     

    Community Support Team _ zhenbw

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

3 Replies

  • NicolPuglia , Not very clear. But create a color measure using the filter and use that in conditional formatting, after selecting field option

    Color Date = if(FIRSTNONBLANK('Date'[date],TODAY()) <today(),"lightgreen","red")

     

    Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
    Color Year = if(FIRSTNONBLANK('Date'[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK('Date'[Year],2014)>2018,"red","yellow"))

    Color = if(FIRSTNONBLANK('Date'[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170
    ,"lightgreen",if(FIRSTNONBLANK('Date'[Year],2014)>2018,"red","yellow"))

     

    https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column

     

     

    • NicolPuglia's avatar
      NicolPuglia
      Frequent Visitor

      Hi!

       

      Very Thanks!

       

      But i want to show in the table widget only 100 record and color them

       

      Thanks

       

      Nicola

  • v-zhenbw-msft's avatar
    v-zhenbw-msft
    Community Support

    Hi NicolPuglia ,

    We can use the following steps to meet your requirement.

     

    1. Create a measure to calculate the value of rows.

     

    Measure = 
    var x = MAX('Table'[date])
    return
    CALCULATE(DISTINCTCOUNT('Table'[date]),FILTER(ALLSELECTED('Table'),'Table'[date]<=x))

     

    2. Then we can configure the Total measure’s conditional formatting using [Measure].

     

     

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?

    BTW, pbix as attached.

     

    Best regards,

     

    Community Support Team _ zhenbw

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