Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi Everybody.
I have 2 tables
Table A: ( date, prod_id, costs)
Table B: ( date, prod_id, incomes)
Table C: (prod_id, description)
Relationship TableA , TableC cardinality Many to Ones (prod_id)
Relationship TableB , TableC cardinality Many to Ones (prod_id)
n:m relations between TableA & TableB
I need to resolve gross_margin = incomes - costs by dates
What must I do ??
wich will be the DAX formulas that need ins measures o calculaed columns ???
Thnks in advance
Solved! Go to Solution.
Hi @davaru,
I would suggest you to use Merge Queries option in Query Editor to merge Table A and Table B into a single table(let's call it "NewMergedTable") with match columns of "date" and "prod". For more details about how to this, you can refer to this article.
Then you should be able to use the formula below to create a calculate column called "gross_margin" within the "NewMergedTable".
gross_margin = 'NewMergedTable'[incomes] - 'NewMergedTable'[costs]
Regards
Hi @davaru,
I would suggest you to use Merge Queries option in Query Editor to merge Table A and Table B into a single table(let's call it "NewMergedTable") with match columns of "date" and "prod". For more details about how to this, you can refer to this article.
Then you should be able to use the formula below to create a calculate column called "gross_margin" within the "NewMergedTable".
gross_margin = 'NewMergedTable'[incomes] - 'NewMergedTable'[costs]
Regards
Tnks for your response.
I would add a "Calendar" table with 1 row per date, e.g. using the CALENDARAUTO function. Then I would relate that to Table A and B.
Then the Gross Margin measure would be something like this:
Gross Margin = SUM ( 'Table B'[incomes] ) - SUM ( 'Table A'[costs] )