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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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