Forum Discussion
ybatistamayo
6 years agoHelper III
RELATIONSHIP
I have two tables, one of "Cost" and one of "Taxes", in the latter the "tax" column is updated every year. also the column that I have to relate both tables is "IDCOST". The first problem is that I...
- 6 years ago
That file has an extension of .7z. I cannot open that on my system.
- 6 years ago
hi, ybatistamayo
For your case, you don't need to create the relationship between two tables, just try this formula to create a measure:
Result = var _table=ADDCOLUMNS(COST,"_Tax",CALCULATE(SUM(TAX[TAX]),FILTER(TAX,COST[IDCOST]=TAX[IDCOST]&&YEAR(COST[DATE])=YEAR(TAX[DATE])))) return SUMX(_table,[QUANTITY]*[PRICE]+[_Tax])
Result:
and here is sample pbix file, please try it.
Regards,
Lin
Ashish_Mathur
6 years agoSuper User
Hi,
Share the link from where i can download your PBI file.
- ybatistamayo6 years agoHelper III
The file has three other tables that I suggested that a previous user add to the model
Here the link
- Ashish_Mathur6 years agoSuper User
Hi,
There is no file there. To avoid confusion, please only share 2 Tables - Cost and Tax. Also, share the correct result for the data that you share.
- ybatistamayo6 years agoHelper III
well here it goes again only with two original tables
and the result I aspire to get is this
total = quantity * price * tax