Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Conditional Formatting based on Average Value of Measure

Hi,

I hope you can help me out with this..

 

I created a bar chart with for each month the percentage assigend value versus turnover.

But I would like to color the bars if the % is higher than the average %. The bars are now colored if the % > 3%.

The bars are based on the following measure:

Assigned Value versus Turnover = DIVIDE([Total Assigned Value];SUM('Claims&Billing'[Turnover Actuals]))
So basically a division of the measures.
 
Do you know how to do this?
 
Thx! 

 

  • hi, Anonymous

    Is " 3% " the overall average value?

    If so, You could try this way:

    Add a new average Value measure by ALLSELECTED/ ALL like

    NOTE: using ALLSELECTED or ALL  depends on whether you will filter date on visual.

     

    NEW Assigned Value versus Turnover 1 =
    DIVIDE (
        [Total Assigned Value],
        CALCULATE (
            SUM ( 'Claims&Billing'[Turnover Actuals] ),
            ALLSELECTED ( 'Date'[Date] )
        )
    )

    OR

    NEW Assigned Value versus Turnover 1 =
    DIVIDE (
        [Total Assigned Value],
        CALCULATE (
            SUM ( 'Claims&Billing'[Turnover Actuals] ),
            ALL ( 'Date'[Date] )
        )
    )

    Step2:

    Create a conditional measure like 

    conditional = IF([Assigned Value versus Turnover]>[NEW Assigned Value versus Turnover 1],1,2)

    Step3:

    Select bar chart, then click Format->Date colors->Advanced controls

    Result:

    In my case, the average is 4.5

    Best Regards,

    Lin

     

5 Replies

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

    hi, Anonymous

    Is " 3% " the overall average value?

    If so, You could try this way:

    Add a new average Value measure by ALLSELECTED/ ALL like

    NOTE: using ALLSELECTED or ALL  depends on whether you will filter date on visual.

     

    NEW Assigned Value versus Turnover 1 =
    DIVIDE (
        [Total Assigned Value],
        CALCULATE (
            SUM ( 'Claims&Billing'[Turnover Actuals] ),
            ALLSELECTED ( 'Date'[Date] )
        )
    )

    OR

    NEW Assigned Value versus Turnover 1 =
    DIVIDE (
        [Total Assigned Value],
        CALCULATE (
            SUM ( 'Claims&Billing'[Turnover Actuals] ),
            ALL ( 'Date'[Date] )
        )
    )

    Step2:

    Create a conditional measure like 

    conditional = IF([Assigned Value versus Turnover]>[NEW Assigned Value versus Turnover 1],1,2)

    Step3:

    Select bar chart, then click Format->Date colors->Advanced controls

    Result:

    In my case, the average is 4.5

    Best Regards,

    Lin

     

    • SoraiaT's avatar
      SoraiaT
      Helper I

      Hi!

       

      The option "Select bar chart, then click Format->Date colors->Advanced controls" is missing in mine. Do you have any idea why?

       

      Thanks,

      Soraia

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

        hi, SoraiaT

        Please update power bi desktop to the latest version.

        In November 2018, this is moved to  Date colors from field.

         

        With this upgrade, you’ll notice the color saturation bucket is no longer in the field well. Instead to format, you’ll go to the Data colors card in the formatting pane. Here you can format with the color pickers as normal or select the Advanced controls option to launch the conditional formatting dialog.

        https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-november-2018-feature-summary/

         

         

        Best Regards,

        Lin

    • AnonymousTurtle's avatar
      AnonymousTurtle
      Regular Visitor

      How would I achieve this if I just want to conditionally format the totals?