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
avatar user
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

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)