The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a matrix I am creating. The columns are only three years of activity and I want to show the difference between only the two final years while still showing the first year.
The matrix currently looks like this
I want to add a column that is the Difference between 2024 and 2025, but 2023 needs to remain in the table.
The data UI is like this:
And this is the actual table
Solved! Go to Solution.
Hi @AK_Micro_User ,
Based on my testing, please try the following methods:
1.Create the measure to calculate difference.
Difference 2024 - 2025 =
VAR Amount2024 =
CALCULATE(
SUM('Test Data'[Amount]),
'Test Data'[Year] = 2024
)
VAR Amount2025 =
CALCULATE(
SUM('Test Data'[Amount]),
'Test Data'[Year] = 2025
)
RETURN
IF(SELECTEDVALUE('Test Data'[Year]) = 2024, Amount2024 - Amount2025, BLANK())
2.Drag the measure into the matrix visual.
3.The result is shown below.
What’s more, set the wrap in the format visual.
Drag the border to hide the other difference.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AK_Micro_User ,
Based on my testing, please try the following methods:
1.Create the measure to calculate difference.
Difference 2024 - 2025 =
VAR Amount2024 =
CALCULATE(
SUM('Test Data'[Amount]),
'Test Data'[Year] = 2024
)
VAR Amount2025 =
CALCULATE(
SUM('Test Data'[Amount]),
'Test Data'[Year] = 2025
)
RETURN
IF(SELECTEDVALUE('Test Data'[Year]) = 2024, Amount2024 - Amount2025, BLANK())
2.Drag the measure into the matrix visual.
3.The result is shown below.
What’s more, set the wrap in the format visual.
Drag the border to hide the other difference.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much! I am still so new to DAX that seeing it written out from the perspective of my data is incredibly useful. The hiding columns trick is also great to know.
Mixing concepts in the same visual will confuse your users.
Anyway - you can use Visual Calculations to achieve that.