Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Calculating Variance

I have a table (see below) that we are hoping to look at the variance PER ROW CELL.  Meaning.... if the ACTUAL number has a >20%, then that CELL will turn YELLOW.  if you look at the table below, you will see a couple cells that the number is greater that 20% variance from the AGREED cell right next two it.  For example there are a couple cells in this screenshot that show 4 and 6.  the respect Actual cell next to each is 0 so they would turn YELLOW.  

 

We do not want to compare all the data as a collective but each row's two cells to each other (Agreed vs Actual).  Can someone tell me how to make the Actual Cell turn yellow if its cell number has a greater variance of 20% vs its neighbors Agreed cell?

 

cnorris3570_0-1646415275018.png

 

1 ACCEPTED SOLUTION
rocky09
Solution Sage
Solution Sage

I hope, I understood your question properly.
Try this.
create a measure:

_variance = 
IF(
AVERAGEX(data,
        data[Monday Agreed] - data[Monday Actual]) > 2,"#F5E633","#fff")

Then, apply the conditional formatting of the column and select the measure.

rocky09_0-1646418765260.png

 

View solution in original post

7 REPLIES 7
rocky09
Solution Sage
Solution Sage

I hope, I understood your question properly.
Try this.
create a measure:

_variance = 
IF(
AVERAGEX(data,
        data[Monday Agreed] - data[Monday Actual]) > 2,"#F5E633","#fff")

Then, apply the conditional formatting of the column and select the measure.

rocky09_0-1646418765260.png

 

Anonymous
Not applicable

okay for Tuesday ......... thru Saturday, how is the code written as i have columns for Tuesday Agreed, Tuesday Actual....... Saturday Agreed, Saturday Actual in the same table?

_variance =
IF(
AVERAGEX(ManPowerTable,
ManPowerTable[Monday Agreed] - ManPowerTable[Monday Actual]) > 2,"#F5E633","#fff")




rocky09
Solution Sage
Solution Sage

do you have a date column as well?

Anonymous
Not applicable

i have a date table with a date column but  this table does not have a date column in it.

rocky09
Solution Sage
Solution Sage

are you trying to compare Agreed vs Actual? or variance between Agreed previous cell vs Agreed Current cell and the same with Actual?

Anonymous
Not applicable

im actually trying to compare Agreed previous cell vs Agreed Current cell...... like this:

cnorris3570_1-1646416069413.png

 

the 0 would turn yellow.   for each ROW that the second cell (Actual) is greater than the 20%, then it would turn yellow.  

Anonymous
Not applicable

so in that table i first posted, only two cells would have turned YELLOW.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors