- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Calculate Percentage Change from previous Year
Hi,
I wonder if anyone can help me. I have the below measure which is calculating the percentage change of "Suppliers" from current month from the previous month.
So in 2021 January had 154 suppliers and February had 147 suppliers so the percentage change in suppliers is -5%.
However, instead, I need this to calculate the percentage change from the current month and year from the previous month and year.
So February 2021 had 147 suppliers and February 2020 had 151 suppliers. The percentage change would be -3%
I keep getting a column value error.
Please could someone help? Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @clarkey1988 ,
First create a calendar table,then create a relationship between the 2 tables.
Create a measure as below:
Measure =
VAR _previous =
CALCULATE ( SUM ( 'Table'[Supplier] ), DATEADD ( 'Table'[date], -1, MONTH ) )
VAR _current =
CALCULATE (
SUM ( 'Table'[Supplier] ),
FILTER ( 'Table', 'Table'[date] = MAX ( 'Table'[date] ) )
)
RETURN
IF (
ISINSCOPE ( 'Table'[Month] ),
SUM ( 'Table'[Supplier] ),
FORMAT ( DIVIDE ( _current - _previous, _previous ), "percent" )
)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @clarkey1988 ,
First create a calendar table,then create a relationship between the 2 tables.
Create a measure as below:
Measure =
VAR _previous =
CALCULATE ( SUM ( 'Table'[Supplier] ), DATEADD ( 'Table'[date], -1, MONTH ) )
VAR _current =
CALCULATE (
SUM ( 'Table'[Supplier] ),
FILTER ( 'Table', 'Table'[date] = MAX ( 'Table'[date] ) )
)
RETURN
IF (
ISINSCOPE ( 'Table'[Month] ),
SUM ( 'Table'[Supplier] ),
FORMAT ( DIVIDE ( _current - _previous, _previous ), "percent" )
)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your formula looks a little complex. Have you considered using SAMEPERIODLASTYEAR () or one of the Quick Measures?
I also don't see the column error you mention.
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Microsoft Fabric Community Conference 2025
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
Subject | Author | Posted | |
---|---|---|---|
03-31-2024 04:17 PM | |||
05-21-2024 08:11 AM | |||
Anonymous
| 11-13-2019 12:18 AM | ||
04-12-2024 07:55 AM | |||
10-24-2023 05:32 AM |
User | Count |
---|---|
121 | |
73 | |
59 | |
57 | |
44 |
User | Count |
---|---|
181 | |
120 | |
82 | |
65 | |
57 |