Forum Discussion
Related
- Anonymous5 years ago
Hi amitchandak
The Relationship meets at another table. But I figured out there was another table i could make a relation with (a date table) and after that, i used the relatedtable function with sumx and that worked out with a charm. But good to know: userelationship.
Hi PaulDBrown
Thanks for the reply. Since I could use the relatedtable function with sumx, everything works fine. But that's a great way with a virtual table.
Anonymous
You can create a virtual relaionship bewteen two unrelated tables using the TREATAS function as the filter expressions. For example, say you had two unrelated tables:
Table 1
| Country ID | Forecast |
|
US |
100 |
| Japan | 110 |
| UK | 120 |
| Germany | 130 |
Table 2
| Country ID | Sales |
|
Japan |
95 |
| Germany | 75 |
| US | 105 |
| UK | 95 |
You could create the following measures:
1)
Sum of sales = SUM(Table2[Sales])
2)
Sum of Forecast = SUM(Table1[Forecast])
3)
Sales (TREATAS) = CALCULATE([Sum of Sales],
TREATAS(VALUES(Table1[Country ID]), Table2[Country ID))
Then create a visual using the field Table1[Country ID] and the [Sum of Forecast] and [Sales (TREATAS)] and both would be filtered by the Country ID.
Make sense?