Forum Discussion
Sum data by dates from 2 different tables
- 8 years ago
Create a calendar table and build relationship on date column with your existing tables.
I have linked the table in the below manner:
Table1[Salesman] n-->1 SalesmanTable[Salesman] 1<--n Table2[Salesman]
However, when I try to visualise my measure in an histogram by month, I get the same value for each month which is a clear indication that PowerBI doesn't know how to manage the date slicer.
Mesure is more or less the below:
SUMX(Table1, Table1[Price])+SUMX(Table2, Table2[Price])
Create a calendar table and build relationship on date column with your existing tables.
- SuperSayan8 years ago
Resolver I
Hello v-chuncz-msft,
I was a bit reluctant to go down that road but at this point it looked like a good way out.
So I did that and I got a very surprising behaviour.
I am using one date from a table in different measure with the year info (example below), sorry my Power BI is in French...
But the error message is not very complicated, it is telling me that the date in my table (that I linked to the calendar table) has no "Year" attribute... I confirm my data is Date type (dd/mm/yyyy format).
réalisé 2017 = COUNTROWS(FILTER(HistoriqueInter;HistoriqueInter[FinréelleDateH].[Year]=2017))
PS: As soon as I remove the relationship on the date between my content table and the calendar table, the measure is working again...
- v-chuncz-msft8 years ago
Community Support
- SuperSayan8 years ago
Resolver I
Works fine, don't know why it changes the behaviour or why I didn't think about that workaround myself.
Thanks!