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

Join 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.

Reply
js124
Frequent Visitor

Matrix table question

I've created a matrix table showing Media Division % for 2018 and 2019: 

 

2019-09-29 22_09_17-Power BI RAPv5 tj - Power BI Desktop.png

Instead of a Totals column, which is adding 2018 and 2019 percentages together, I want to have a column on the right showing the variance between 2018 and 2019 percentages.

 

Is there a way to achieve this?

 

 

5 REPLIES 5
Nathaniel_C
Community Champion
Community Champion

Hi @js124 ,

 

Create a column in PQ or PBI and use your variance formula, then drop the column into the matrix. Or create a  measure such as DIVIDE(2018-2019, 2018)

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Nathaniel_C ,

 

Unfortunately it doesn't like it will be as simple as the solution you mentioned. 

 

I have the columns filtered by Year for 2018 and 2019, with the values being displayed at a percentage of the column totals:

 

2019-09-30 10_02_22-Power BI RAPv5 tj - Power BI Desktop.png  2019-09-29 22_09_17-Power BI RAPv5 tj - Power BI Desktop.png

And for clarification, I'm just looking for the difference between 2018 and 2019. So if the percentage of digital was 18.70% in 2018 and 16.96% in 2019, I'll like a column in the right to display as -1.74%.

 

 

Anonymous
Not applicable

Hi

 

I would make a measure like the one below (you should probably make something more dynamic on the year filtering to make it apply in 2020):

value measure = 

    IF(
        ISFILTERED('Table'[Year]);
        SUM('Table'[Value]) / CALCULATE( SUM( 'Table'[Value]); ALLEXCEPT( 'Table'; 'Table'[Year]));
        CALCULATE( SUM('Table'[Value]); 'Table'[Year] = 2019) - CALCULATE( SUM( 'Table'[Value]); 'Table'[Year] = 2018)
    )

If this works then please mark it as the accepted solution.

Thanks @Anonymous . While I can understand the logic, unfortunately I'm getting errors when trying to use the measure you suggested:

2019-09-30 11_30_28-Power BI RAPv6 tj - Power BI Desktop.png

Anonymous
Not applicable

If you have an american setup then you should probably change the semicolons to commas.

 

Is your datamodel just one table or do you have multiple tables, i.e. dimDate?

 

IF(
        ISFILTERED('Table'[Year]),
        SUM('Table'[Value]) / CALCULATE( SUM( 'Table'[Value]), ALLEXCEPT( 'Table', 'Table'[Year])),
        CALCULATE( SUM('Table'[Value]), 'Table'[Year] = 2019) - CALCULATE( SUM( 'Table'[Value]), 'Table'[Year] = 2018)
    )

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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