Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
Im trying to add a column to my Matrix table which will show the Percentage increase/decrease of Volume from Last year to Current Year (this will be effected by filter so if I select 2024 it will compare 2023 to 2024 and so on the Matrix
My data looks like this in power BI, the Volumes are what I want to show but on the Matrix table I have it has a list of Activities A-H a few other measures that are summed by the activity and year (based on the filter on the page) then I want to have a column that says Previous Year Volume which will be a sum of Activity A for lets say 2022 then another Column that shows Sum of A for 2023 then a percentage of the increase or decrease so 50% increase or 30% decrease. THANKS in advance for the help
Date | Activities | Volumes | Checks | DS | Cost |
2022 | A | 3400 | 1 | 4 | 55 |
2022 | B | 4005 | 0 | 3 | 56 |
2022 | C | 2221 | 2 | 2 | 6636 |
2022 | D | 2154 | 0 | 1 | 6564 |
2022 | E | 5244 | 0 | 3 | 36 |
2022 | F | 4586 | 0 | 3 | 785 |
2022 | G | 1564 | 0 | 2 | 3456 |
2022 | H | 15987 | 0 | 1 | 636 |
2023 | A | 1561 | 2 | 4 | 267 |
2023 | B | 3216 | 0 | 6 | 547 |
2023 | C | 6541 | 2 | 6 | 873 |
2023 | D | 3465 | 2 | 4 | 333 |
2023 | E | 3216 | 0 | 4 | 22 |
2023 | F | 321 | 0 | 2 | 515 |
2023 | G | 3244 | 0 | 12 | 6 |
2023 | H | 13525 | 0 | 2 | 7 |
Solved! Go to Solution.
Hi,
PBI file attached.
Hope this helps.
Hi, @Bc0303
You can refer to @Ashish_Mathur and @lbendlin reply, if they don't meet your needs, you can try using the following measures to solve your problems.
Measure:
Changes in Volumes =
VAR _slicerYear =
SELECTEDVALUE ( 'Year'[Date] )
VAR _tableYear =
SELECTEDVALUE ( 'Table'[Date] )
VAR _preVolumes =
CALCULATE (
MAX ( 'Table'[Volumes] ),
FILTER ( 'Table', 'Table'[Date] = _slicerYear - 1 )
)
VAR _curVolumes =
CALCULATE (
MAX ( 'Table'[Volumes] ),
FILTER ( 'Table', 'Table'[Date] = _slicerYear )
)
VAR _diff = _curVolumes - _preVolumes
VAR _result =
DIVIDE ( _diff, _preVolumes )
RETURN
_result
Previous Year =
VAR _slicerYear =
SELECTEDVALUE ( 'Year'[Date] )
VAR _result = _slicerYear - 1
RETURN
_result
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, @Bc0303
You can refer to @Ashish_Mathur and @lbendlin reply, if they don't meet your needs, you can try using the following measures to solve your problems.
Measure:
Changes in Volumes =
VAR _slicerYear =
SELECTEDVALUE ( 'Year'[Date] )
VAR _tableYear =
SELECTEDVALUE ( 'Table'[Date] )
VAR _preVolumes =
CALCULATE (
MAX ( 'Table'[Volumes] ),
FILTER ( 'Table', 'Table'[Date] = _slicerYear - 1 )
)
VAR _curVolumes =
CALCULATE (
MAX ( 'Table'[Volumes] ),
FILTER ( 'Table', 'Table'[Date] = _slicerYear )
)
VAR _diff = _curVolumes - _preVolumes
VAR _result =
DIVIDE ( _diff, _preVolumes )
RETURN
_result
Previous Year =
VAR _slicerYear =
SELECTEDVALUE ( 'Year'[Date] )
VAR _result = _slicerYear - 1
RETURN
_result
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Do you want this as a measure or a visual calculation?
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
93 | |
89 | |
35 | |
35 |
User | Count |
---|---|
154 | |
102 | |
82 | |
64 | |
54 |