Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello everyone,
is it possible to display percent changes alongside a line chart?
That is my use case:
I would like to display this in the graph in between the sum values.
E.g. from 2009 with 2618 to 2010 with 6127.
This functionality would be sufficent for consecutive years .
Thanks and Regards,
Chris
Solved! Go to Solution.
calendar TABLE = CALENDAR("2001-01-01","2016-12-31")
LastYearAmount = CALCULATE(SUM('GGE Amounts'[GGE in kg CO2e]),PREVIOUSYEAR('calendar TABLE'[Date]))
Check the details in the attached pbix, the unzip password is sent via private message.
A line and column combo chart would be a better visual to show. In this case, the key is the PREVIOUSYEAR function. Check more details in the attached pbix.
Percent Change = VAR LastYearAmt = CALCULATE ( SUM ( Table1[GGE in kg CO2e] ), PREVIOUSYEAR ( Table1[Date] ) ) RETURN IF ( ISBLANK ( LastYearAmt ), 0, ( SUM ( Table1[GGE in kg CO2e] ) - LastYearAmt ) / LastYearAmt )
Hi!
I'm having the same problem as in this post. I checked your PBIX file and the solution seems to do what it should but in your example, you have only one entry per year:
In my case, I have several entries per month in each year. So, what I get is this:
Is showing me the trend along each month from (sept) 2013 to (July) 2020. How can I make it appear only per the year 2013 to 2020?
I hope you could answer this post as I know is pretty old.
Thanks in advance!
Hi Eric,
that is a very cool possibility.
I can't get it work with my setting.
You have my .pbix, could you maybe try it?
I tried: LastYearAmount = CALCULATE(SUM('GGE Amounts'[GGE in kg CO2e]);PREVIOUSYEAR('Models'[Release Date]))
I don't get an error with that, but it's not given an result.
I would expect to get this table (from your example) but with my dates:
Best would be to only have the years in the first row.
Therefore, I tried it with my year extraction: YEAR('Models'[Release Date]), but that's not working at all.
Thanks and Regards,
Chris
calendar TABLE = CALENDAR("2001-01-01","2016-12-31")
LastYearAmount = CALCULATE(SUM('GGE Amounts'[GGE in kg CO2e]),PREVIOUSYEAR('calendar TABLE'[Date]))
Check the details in the attached pbix, the unzip password is sent via private message.
Hi Eric,
thank you very much, that works!
But it is not possible without the calender table, right?
Why can't I use my year column for that?
Regards,
Chris
The function PREVIOUSYEAR/MONTH and some other timeintelligence functions should be on contiguous, nonrepeating dates.
completed line chart
DatasetI tried to use the example above to get percent change to calculate for my data and couldn't get it to work for the life of me.
Hi @Patt,
Show a dataset, explain the question and show the expected result.
The data set shows staff levels (each liene and average salary (y-axis) from 2010 to 2017 (x-axis). I would like to show the year on year percent change for salary over the 2010 to 2017 period on the graph. Screenshot of the data and graph are attached. The data used for the line chart are the engineer types, engineer salary and date (dd/mm/yyy).
completed line chart
Dataset
Hi,
Share the link from where i can download your file.
User | Count |
---|---|
145 | |
71 | |
69 | |
53 | |
52 |
User | Count |
---|---|
208 | |
94 | |
64 | |
60 | |
57 |