Forum Discussion
Comparing years in line graph
I understand. To use my sample code follow the below steps.
Go to Transform data.
Right click in a blank area in the query pane and select New Query --> Blank Query
With the query selected, choose Advanced Editor
Paste my code over what is there and click done.
You'll then be able to see the steps I followed.
Essentially, all you're trying to do is add a column for year for the legend and one for a date part of some kind that excludes year (I used week number) for the X axis.
What you end up with is...
Thanks so much!
I did this on my table and it created the new queries and i see them, but they have no effect on my table right now. I tried creating relationships between the date and my tables, but it doesn't do anything. Do I have to customize your code to fit with my tables and correct column names that I'm pulling from my server? I'm using several different sections of a server to bring information together.
- KNP5 years agoSuper User
I only included that query to serve as an example of how I'd approach it so you could see the individual steps. Sorry, I may not have explained that well.
What you need is a 'year' (in your date dimension if you have one) for the legend and something for your X axis like week number.
Are you able to attach a screen shot of your model showing the joins? I might be able to offer better advice if I can see the data model.
- josephmwood5 years agoRegular Visitor
I appreciate you helping me out!
Here's a screenshot of the settings for my current line graph.
Let me know if that helps at all.
- KNP5 years agoSuper User
It's the screenshot of the model that would be most helpful. (and probably the graph)
How does the Power BI version of the graph look right now?