Forum Discussion
Sum data by dates from 2 different tables
Hi Everyone,
I'm trying to sum data from 2 different tables. Here is a simplification of the data:
Table 1:
- Column 1: date of sale
- Column 2 : price of sale
A lot of other columns
Table 2:
- Column 1 : date of another type of sales
- Column 2 : price
Few other columns.
I don't want to append both table because I have a lot of visuals based on table 1 and I don't want to add rows without all the columns as it will mess up my visualisation.
My goal is to be able to sum all the prices from both table in a measure (that's the easy part) and being able to visualise by month or year. The issue being both table have their own date reference.
I'm not sure this is very clear, don't hesitate if you need more info.
Create a calendar table and build relationship on date column with your existing tables.
8 Replies
- Greg_DecklerCommunity Champion
Are these tables related to one another?
- SuperSayanResolver I
Greg_Deckler, they are not related. However they have a common attribute (salesman). This value is not unique in any of those table but I have a salesman table so I could link both table through this salesman table.
Would that help?- Greg_DecklerCommunity Champion
Yes, if you link the tables then you could theoretically use the date column from either one of them, just depends on how you want to slice it.