Forum Discussion
paulthangaraj
6 years agoRegular Visitor
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 ...
Greg_Deckler
Community Champion
6 years agopaulthangaraj - 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.
- paulthangaraj6 years agoRegular 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.