We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I've been asked to show % change between years on the following chart. At present there are two lables per X-axis value because there are two years included in my legend. Is it possible to have one lable per X-axis value, and that lable be the % change from 2019 to 2020? Or is there a better way to show this data?
Thank you,
Tim
Solved! Go to Solution.
hi @TimNYC
I think the best way is add it into Tooltip of line chart.
and there is another workaround for you refer to:
Step1:
Use combo chart instead of line chart in the report.
https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-combo-chart
Step2:
Create different measure by year, eg.
2019 = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]=2019))
2020 = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]=2020))
Step3:
Drag these measures into line values.
Step4:
Create a Percent Change measure like below:
Difference =
var lastyear= CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table'[Year]), 'Table'[Year] = MAX ( 'Table'[Year] ) - 1 )
)
return
DIVIDE(CALCULATE(SUM('Table'[Value]))-lastyear,lastyear,BLANK())
Then drag this measure into column values
Step5:
You could change the color of the column to white and custom the two Y-axis in format.
Result:
and here is sample pbix file, please try it.
Regards,
Lin
hi @TimNYC
I think the best way is add it into Tooltip of line chart.
and there is another workaround for you refer to:
Step1:
Use combo chart instead of line chart in the report.
https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-combo-chart
Step2:
Create different measure by year, eg.
2019 = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]=2019))
2020 = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]=2020))
Step3:
Drag these measures into line values.
Step4:
Create a Percent Change measure like below:
Difference =
var lastyear= CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table'[Year]), 'Table'[Year] = MAX ( 'Table'[Year] ) - 1 )
)
return
DIVIDE(CALCULATE(SUM('Table'[Value]))-lastyear,lastyear,BLANK())
Then drag this measure into column values
Step5:
You could change the color of the column to white and custom the two Y-axis in format.
Result:
and here is sample pbix file, please try it.
Regards,
Lin
Hello @TimNYC
I prefer to include such KPIs as Tooltips. It helps in keeping the visual clean.
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 33 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 40 | |
| 34 | |
| 25 |