cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

Percentage Increase Prior Year vs This Year

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
2 ACCEPTED SOLUTIONS
Super User

Hi,

PBI file attached.

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Community Support

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!

3 REPLIES 3
Community Support

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!

Super User

Hi,

PBI file attached.

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Super User

Do you want this as a measure or a visual calculation?

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Monthly Update - June 2024

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

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors