Forum Discussion
Fields
- 8 years ago
First picture below shows bi-directional relationship between tables.
Second picture shows measure for year 2016.
Hope help you.
Best regards,
Hi,
First, you need to transform both columns year and its values in 2 columns only.
After that you can use:
GrossTurneverYear2016 =
SUMX (
FILTER (
Table#2;
PriceYear = 2016
);
PriceValue2016 * RELATED ( Table#1[Q-ty])
)
Regards,
If I transform both columns year and its values in 2 columns I will get many to many relationship because id_product in first and second table will repeat
- Thyago_Rezende8 years agoResolver I
You will can use Treatas pattern. It provides virtual relationship between tables.
Try do this:
http://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/
- Grizman8 years agoHelper I
Can you reveal in my example?
- Thyago_Rezende8 years agoResolver I
Is there no primary key on the Table1 ?
- Grizman8 years agoHelper I
In Table 1 primary key is Id_transaction, but not a Id_product.
Id_product repeat in Table 1
- Grizman8 years agoHelper I
In you recommended case scenario after unpivoted colums I cann't create relationship beetween two table.
Because column Id_product in Table 1 and after unpivoted column Id_product in Table 2 will not unique .
In Table 1 primary key is id_transaction.
Have your new ideа?
- v-qiuyu-msft8 years agoCommunity Support
Hi Grizman,
Please review my previous post, I have created a pbix file based on the sample data in your original post.
What's the problem in your scenario now? I didn't see the id_transaction in your table data, please clarify sample data and your requirement.
Best Regards,
Qiuyun Yu