Forum Discussion
Different years on same line graph.
PBI Desktop v March 2023 on Windows.
The boss wants me to make a line chart where each fiscal year he selects is a DIFFERENT line on the chart so different years we can compare the number of overtime hours per Fiscal Year and pay period. I have not been able to get this to work yet.
The below graph is from someone else and it shows 2 different lines. In my case each line would be for a fiscal year. But the data for me would be overtime hours per pay period.
I have a slicer which is the fiscal year as a string. (It's normally a number.)
The data source is a spreadsheet. We cannot change the columns in the spreadsheet. Some of the columns are: Department, Overtime hours, Fiscal year (as string), Pay Period, FiscalYr-PayPeriod (as a string).
The boss wants to see different fiscal years as different colored lines on the same graph based on the fiscal years he chooses on the Fiscal Year slicer. Later on I have to copy this tab in the report to show regular hours, and double time hours.
I tried adding the FiscalYr-PayPeriod to the Legend slot but that doesn't do what I want.
We also do not use third-party visualizations.
How do I do this? Thank you.
Ok I got it. I hope this helps other people. I made a line graph and here are my main settings.
- Pay period is a number 1-26. We are paid every 2 weeks so there are 26 pay periods in a fiscal year.
- Overtime Hrs is a number.
- Fiscal Year is a number.
Here is our slicer. To make this type of slicer I created a new column: Fiscal Yr Str = FORMAT([Fiscal Year],"####") Format always outputs a string.
Now the boss can choose any or all fiscal years to compare.
1 Reply
- croberts21
Continued Contributor
Ok I got it. I hope this helps other people. I made a line graph and here are my main settings.
- Pay period is a number 1-26. We are paid every 2 weeks so there are 26 pay periods in a fiscal year.
- Overtime Hrs is a number.
- Fiscal Year is a number.
Here is our slicer. To make this type of slicer I created a new column: Fiscal Yr Str = FORMAT([Fiscal Year],"####") Format always outputs a string.
Now the boss can choose any or all fiscal years to compare.