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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Mandalorian
Frequent Visitor

Creating Variance Column in Table Matrix with Values as Rows

I am trying to create a variance column for a YoY calculation in the P&L below. I cannot figure out how to calculate this variance since the P&L is a table matrix with values as rows. The year columns are from my date table and only have 2 years.

Mandalorian_0-1689622284235.png

Below is the formula that is not working. The formula does not calculate the difference between the years and I am unable to put the formula in the columns section above or below the Year field. Is there a way to add a variance field or is there an easier way to build a P&L in PBI?

Variance =
Var PY = CALCULATE(SELECTEDMEASURE(), FILTER('Date Table', 'Date Table'[Year] = 2022))
Var CY = CALCULATE(SELECTEDMEASURE(), FILTER('Date Table', 'Date Table'[Year] = 2023))
Var Result =
CY - PY
Return Result
1 REPLY 1
Anonymous
Not applicable

Hi @Mandalorian ,

In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_Binbin Yu

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.