Forum Discussion
Shared Axis on different data tables - line graph
I have 2 data tables which showed 2 oil wells with different production start date. I want to show on a line graph the 2 wells with the same day of production on the x-axis. However, my graph shows one table with the correct production but the other one is always a flat line. Any ideas on what I'm doing wrong? see tables below-
Anonymous solution attached.
12 Replies
- parry2kSuper User
Anonymous you need to have date. dimension in your model and then link your both tables with date dimension and on x-axis use date from date dimension and value from these two tables, it will work as expected.
There are many blogs on how to create date/calendar dimension in your model using DAX or PowerQuery. Hope it is helpful.
- AnonymousNot applicable
Thanks but it is not quite what I'm after using a calendar table. I want production on the same "Days of Production" on the using Day 1 as the start date.
- AnonymousNot applicable
Here's the correct view but in excel. I would prefer to do it in PBI
- parry2kSuper User
Anonymous it should work, it is plotting correctly based on your data. if you want to show day number on x -axis, just add another column in your date dimension. if there is production on day 1, it will show up. I don't have visibility to your data so cannot comment why it is not showing for day #1
- jtownsend21Responsive Resident
My first suggestion is to append the two tables together in the query editor. I have a similar data set that I do this with.
Alternatively if you don't wish to create a new table you can create a relationship between the two tables on "Days of Production" but leave it inactive. From there create a new measure:
Measure = CALCULATE( SUM( 'Table 1'[Oil (Barrels Produced)], 'Table 2'[Oil (Barrels Produced)] ), USERELATIONSHIP( 'Table 1'[Days of Production], 'Table 2'[Days of Production] ) )- parry2kSuper User