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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
dlogan
Helper I
Helper I

Matrix Visual: Compare 2 coulumns

Is it possible to compare one column with another column in a matrix visual? In other words, I need to calculate the year over year change in acres. Any help would be much appreciated.

 

dlogan_0-1721045714995.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@amitchandak  Thanks for your contribution on this thread.

Hi @dlogan ,

Whether your problem has been resolved? If yes, could you please mark your post as Answered?

Otherwise, you can create a measure as below and put it on Values option of matrix...

 

Difference =
VAR _year =
    SELECTEDVALUE ( 'Table'[Year] )
VAR _category =
    SELECTEDVALUE ( 'Table'[Category] )
VAR _preyear =
    SUMX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Category] = _category
                && 'Table'[Year] = _year - 1
        ),
        [Total Acres]
    )
RETURN
    [Total Acres] - _preyear

 

If the above ones can't help you figure out, please provide some raw data in your tables(exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@amitchandak  Thanks for your contribution on this thread.

Hi @dlogan ,

Whether your problem has been resolved? If yes, could you please mark your post as Answered?

Otherwise, you can create a measure as below and put it on Values option of matrix...

 

Difference =
VAR _year =
    SELECTEDVALUE ( 'Table'[Year] )
VAR _category =
    SELECTEDVALUE ( 'Table'[Category] )
VAR _preyear =
    SUMX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Category] = _category
                && 'Table'[Year] = _year - 1
        ),
        [Total Acres]
    )
RETURN
    [Total Acres] - _preyear

 

If the above ones can't help you figure out, please provide some raw data in your tables(exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

amitchandak
Super User
Super User

@dlogan , Create a YOY measure and push that to Grand total using isinscope

 

Current Measure = (SUM(Sales[Sales Amount])

Year behind Measure = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

YOY = divide( [Current Measure] -[Year behind Measure], [Year behind Measure])

 

Final Measure = If(isinscope(Date[Year]), [Current Measure], [YOY])

 

Assuming you are using a date table and date table's field are using in slicer, visual and mesure

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.