cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

## Trying to create a difference column in a matrix table

Hi,

I have a matrix table which shows the sales for products this year and last year. All I want to do is add a column which shows the difference between these two columns. I've been trying all afternoon but getting nowhere.

Here's the source data (much simplified version of my real data, but the same dilema exisits!)

And my matrix table looks like this:

All I want to do is add a third column of values to the matrix table to show the difference between TY and LY. For example Product A would be 5, Product B would be 0, Product C would be 10. But when I do this it doesn't display as I'd expect, it shows a strange difference for each year:

Does anybody know what I'm doing wrong?

1 ACCEPTED SOLUTION
Community Support

Make sure it is a measure, not calculated column.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Regular Visitor

By the way, this is the code i'm using to create the difference column:

Difference = CALCULATE ( SUM ( Sheet1[Sales] ), Sheet1[Year] = "TY" )
- CALCULATE ( SUM ( Sheet1[Sales] ), Sheet1[Year] = "LY" )

Community Support

Make sure it is a measure, not calculated column.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors