Forum Discussion
Line Chart (Revenue over Years)
Dear all,
Greetings, i have been creating this Power BI Report with the following Columns
| Project Start Year | Project name | Region | Revenue Current Year | Next Year | in Two years |
| 2015 | AA | APAC | 3.3b | 1.2b | 4.5b |
| 2015 | AB | MEA | 2.5b | 5.3b | 0b |
| 2019 | AV | EUROPE | 1.5b | 3.6b | 3.3b |
| 2020 | AG | APAC | 1.1b | 2.2b | 5.3b |
| 2021 | AG | Europe | 0.0b | 3.3b | 3.3b |
| 2020 | BH | MEA | 3.2 | 3.6 | 1.2 |
| 2025 | DG | Europe | 0.0b | 7.4b | 3.3b |
I like to generate a line chart as follows.
line chart (Revenue)
No idea on how to generate one. I have the table as shown in the table above.
Thank you all 🙂
Looking forward for some guidance.
4 Replies
- Pragati11
Super User
hi paulthangaraj ,
Create a column in your data as follows:
Year Group = IF([Project Start Year] = YEAR(TODAY()), "Current Year",
IF([Project Start Year] < YEAR(TODAY()), "Previous Year", "Next Year"))Create a line chart.
Move Year Group to the axis area, Region column to legend area and move your sumaarised value or a calculation to Values area.
Thanks,
Pragati
- paulthangarajRegular Visitor
Thank you for the reply,
there is a little misunderstanding i guess.
I am using the start year in the report to select. But it does not matter if this is current year or an year later.
Current year is always 2020 for now
in the table i have just the values for the current year and i want the chart to show exactly as current year as mentioned not as 2020 or 2021.
- Greg_Deckler
Community Champion
paulthangaraj - You will want to create a disconnected table using an Enter Data query that contains the values in your axis. Then you create a measure that does a MAX on this disconnected table to grab the value in the axis. You can then use this in a SWITCH statement to concoct the desired calculation for that axis point. So, something like:
Measure = VAR __AxisValue = MAX('Table'[Value]) // this is your Enter Data disconnected table RETURN SWITCH(__AxisValue, "Current Year",SUMX(FILTER('DataTable',[Project Start Year] = YEAR(TODAY())),[Revenue Current Year]), "Next Year",SUMX(FILTER('DataTable',[Project Start Year] = YEAR(TODAY())),[Next Year]), "in Two years",SUMX(FILTER('DataTable',[Project Start Year] = YEAR(TODAY())),[in Two Years]) )That's one way. The other way would be to unpivot your last three columns in Power Query. That would probably be preferred. Then you don't need the measure or disconnected table and it is dirt simple.
- paulthangarajRegular Visitor
I have pivoted all the three columns but to get the values in the VAlue all the three is not possible, How to do that ? Here is the screenshot.