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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
mohammedkhan
Helper I
Helper I

Difference between Column Values in the Matrix Visual

I have a Table in which it has Stattion Type, total Rev (meaasure) and Year

 

Matrix Looks this:

 

Station Type2015201620172018
ABC1082015
XYZ1261510


And Need Something better or like this

Station Type20152016Difference20172018Difference
ABC108220155
XYZ126615105
       
1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @mohammedkhan ,

 

 

If you drag-and-dropped those columns onto your table, then Power BI automatically creates an implicit measures in the background that likely looks like SUM(Table[2015]) and SUM(Table[2016]). To calculate the difference, create a measure to subtract the second from the first:

Difference1 = SUM('Table'[2015]) - SUM('Table'[2016])

If you need to determine the size of the data corresponding to the year, the larger data is subtracted from the smaller:

Difference1 =

var test1= SUM('Table'[2015])

var test2= SUM('Table'[2016])

var test3=IF(test1>test2,test1-test2,test2-test1)

return test3

v-luwang-msft_0-1618302038377.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @mohammedkhan ,

 

 

If you drag-and-dropped those columns onto your table, then Power BI automatically creates an implicit measures in the background that likely looks like SUM(Table[2015]) and SUM(Table[2016]). To calculate the difference, create a measure to subtract the second from the first:

Difference1 = SUM('Table'[2015]) - SUM('Table'[2016])

If you need to determine the size of the data corresponding to the year, the larger data is subtracted from the smaller:

Difference1 =

var test1= SUM('Table'[2015])

var test2= SUM('Table'[2016])

var test3=IF(test1>test2,test1-test2,test2-test1)

return test3

v-luwang-msft_0-1618302038377.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

amitchandak
Super User
Super User

@mohammedkhan , this kind of custom display , you might not get in matrix. You can diff after every year

 

With help from a separate year/date table you can get

 

example measures 

This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

 

check the hybrid display 

 

if you are looking for a Hybrid display with Matrix Column and measure
https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1...
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/...

vote for Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors