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

Variance column in matrix

Hi,

 

How can I create a third column in a matrix to show variance YOY, without creating individual measures for reach value of Revenue, Costs, Profit, etc.?

 

 20182019third column for VAR
Revenue10000001200000=2019 Rev / 2018 Rev - 1
Costs200000200000etc
Profit8000001000000 

 

Cheers,

 

6 REPLIES 6
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

Here ,we can use a measure as below to work around:

Measure =
var sum18 = CALCULATE(SUM('Table'[values]),FILTER('Table', 'Table'[Year] =2018))
var sum19 = CALCULATE(SUM('Table'[values]),FILTER('Table','Table'[Year]=2019))
return
IF(ISINSCOPE('Table'[Year]),SUM('Table'[values]),sum19/sum18-1)

Besides, you can change the name of  “subtotals label”  from “Total”  into  “third column for Var”  in “format”.

Here’s a sample I made:

Annotation 2019-12-12 160622.png

url:https://wicren-my.sharepoint.com/:u:/g/personal/michael_wicren_onmicrosoft_com/EQBlSvY6aPNApY8nYaDQ5dAB17Pd6KzNSc3UjfwH7Pj_xA?e=RnPL4d

 

Best Regards,

Community Support Team _ Eason Fang

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

Anonymous
Not applicable

Hi @v-easonf-msft,

 

This would work... but my data is structured differenty.

 

In my dataset, I have a column for Revenue, Costs & Profit.  So I need the measure to calculate the variance of that row, I cannot specify I column as there are 3 different columns... 

amitchandak
Super User
Super User

= divide(sum(2019)-sum(2018),sum(2018))

or

measure =

var _a =sum(2019)-sum(2018)

return

divide(_a,sum(2018))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak 

 

Thanks for the quick reply.

 

I'm not sure how I can do "sum(2019)"?

 

Cheers,

Please share your table structure

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak ,

 

See below screenshot... will this work?  or how else can I share my table structure?

F&B Table Structure.PNG

 

I think one of the obstacles here is that each of the rows in the matrix come from different columns in the data table... which means the DAX formula for the variance cannot reference a specific column, but needs to reference the row it is on.

 

Cheers,

Dan

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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