Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have this Matrix and I would like to be able to add a third column to the right that shows the difference between the two year columns. The Matrix is just all these values and then year in the columns. I know this is kinda out of the bounds of what a matrix is meant to do but if anyone has suggestions on how to go about this or a work around please let me know.
Solved! Go to Solution.
Hi @Philfound1199
You may activate the columns total and rename it "Difference". Use the following measure in the matrix visual values.
ResultMeasure =
IF (
HASONEVALUE ( 'Table'[Fiscal Year] ),
[Measure],
CALCULATE ( [Measure], 'Table'[Fiscal Year] = MAX ( 'Table'[Fiscal Year] ) )
- CALCULATE ( [Measure], 'Table'[Fiscal Year] = MIN ( 'Table'[Fiscal Year] ) )
)
Thanks that worked great! If you have the time can you explain how overriding the column subtotal works. I'm trying to have a better understanding of whats going on here.
The following usually comes as a surprise to all new Power Bi users.
The Total in power bi does not actually sum the visible values in the matrix. It is evaluated just as any other cell but in different filter context. In you example the total column is evaluated in the context of ALL ( [fiscal year] ). If the measure is of additive nature, total column will show the sum of all years. However, we can change that and produce the difference for example. By checking IF [fiscal year] HASEONVALUE (such as in f2023 and f2024) we can apply the normal measure while otherwise we can apply the difference between the value of the max year and the value of the min year. As simple as that.
Hi @Philfound1199
You may activate the columns total and rename it "Difference". Use the following measure in the matrix visual values.
ResultMeasure =
IF (
HASONEVALUE ( 'Table'[Fiscal Year] ),
[Measure],
CALCULATE ( [Measure], 'Table'[Fiscal Year] = MAX ( 'Table'[Fiscal Year] ) )
- CALCULATE ( [Measure], 'Table'[Fiscal Year] = MIN ( 'Table'[Fiscal Year] ) )
)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
10 | |
6 |