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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.