Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I need to create line graph to show sales growth trends for past 5 years.
1 line per division for 4 divisions.
Each division had hired division manager, so we need these lines to differentiate the performance of each division prior to and post joining of division manager.
Each division hired manager not at the same time.
Example;
For Division 1, the manager was hired only in year 4
For Division 2, manager was hired in year 2 itself
And so on..
So, my requirement is:
For division 1, the line should change colour from year 4.
For division 2 line should change colour from year 2.
And so on..
If changing colour of line is not possible, then at least
For Division 1, insert a pointer (or marker) on year 4 intersect
For Division 2, insert a pointer (or marker) on year 2 intersect.
Can this be done ?
Please help..
Thanks,
Anand
Solved! Go to Solution.
Hi @friend_anand ,
Try to create a R visual.
1. UnPivot.
2. Create a R visual.
# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:
# dataset <- data.frame(Year, DivisionName, ManagerHireYear, Value)
# dataset <- unique(dataset)
# Paste or type your script code here:
library(ggplot2)
library(dplyr)
dataset2<-dataset %>% filter(Year==ManagerHireYear)
ggplot(data = dataset,aes(y = Value, x = Year, colour = DivisionName)) + geom_line(stat="identity") + geom_point(data=dataset2,aes(x=ManagerHireYear,y=Value))
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @friend_anand ,
Try to create a R visual.
1. UnPivot.
2. Create a R visual.
# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:
# dataset <- data.frame(Year, DivisionName, ManagerHireYear, Value)
# dataset <- unique(dataset)
# Paste or type your script code here:
library(ggplot2)
library(dplyr)
dataset2<-dataset %>% filter(Year==ManagerHireYear)
ggplot(data = dataset,aes(y = Value, x = Year, colour = DivisionName)) + geom_line(stat="identity") + geom_point(data=dataset2,aes(x=ManagerHireYear,y=Value))
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Thanks for your response.
Here is a sample data:
Division Name | Manager Hire Year | 2016 | 2017 | 2018 | 2019 | 2020 YTD |
Division A | 2019 | 84335 | 89426 | 93897.3 | 150235.7 | 180282.8 |
Division B | 2018 | 87572 | 92357 | 129299.8 | 193949.7 | 155159.8 |
Division C | 2017 | 74420 | 141398 | 155537.8 | 202199.1 | 242639 |
Division D | 2018 | 93804 | 73804 | 125466.8 | 188200.2 | 207020.2 |
And below is a chart I made in excel with the above table excluding the 2nd column (Manager Hire Date).
I am looking at an output which will be like below. I have plotted the year in which the manager was hired for each division.
Please advise if this is possbile in Power BI visuals.
Thanks in advance for your help..
Anand
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.