Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hello everyone,
I have a table with the actual category and another column with new category and I would like to calculate the spend difference between the old and the new category.
Let me explain you with an example:
I would like to have the spend in € for each categories for old and new, like that I can compare if we have less or more spend for each category by [New Spend]- [Old Spend].
Thanks for your support !
Solved! Go to Solution.
Create a category dimension table like
Category =
DISTINCT (
UNION (
SELECTCOLUMNS ( DISTINCT ( 'Table'[Old] ), "Category", 'Table'[Old] ),
SELECTCOLUMNS ( DISTINCT ( 'Table'[New] ), "Category", 'Table'[New] )
)
)
and then link this table to the data table for both Old and New columns. Only 1 relationship can be active but thats OK.
You can then create a measure like
Diff old and new =
VAR OldValue =
CALCULATE (
SUM ( 'Table'[Spend] ),
USERELATIONSHIP ( 'Table'[Old], 'Category'[Category] )
)
VAR NewValue =
CALCULATE (
SUM ( 'Table'[Spend] ),
USERELATIONSHIP ( 'Table'[New], 'Category'[Category] )
)
RETURN
NewValue - OldValue
and put this in a visual with the category column from the dimension table
Create a category dimension table like
Category =
DISTINCT (
UNION (
SELECTCOLUMNS ( DISTINCT ( 'Table'[Old] ), "Category", 'Table'[Old] ),
SELECTCOLUMNS ( DISTINCT ( 'Table'[New] ), "Category", 'Table'[New] )
)
)
and then link this table to the data table for both Old and New columns. Only 1 relationship can be active but thats OK.
You can then create a measure like
Diff old and new =
VAR OldValue =
CALCULATE (
SUM ( 'Table'[Spend] ),
USERELATIONSHIP ( 'Table'[Old], 'Category'[Category] )
)
VAR NewValue =
CALCULATE (
SUM ( 'Table'[Spend] ),
USERELATIONSHIP ( 'Table'[New], 'Category'[Category] )
)
RETURN
NewValue - OldValue
and put this in a visual with the category column from the dimension table
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
10 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
8 |