Forum Discussion
calculated field
Hi. I don't know if it is possible make what I want. In a page I have two table which origin is two different table. The two table have some rows and the total. I would create a field that has the difference of the two total. How can I resolve? Thank you.
PS: Sory for my english, I'm from Italy.....
- Anonymous8 years ago
You screenshot is not clear.
Please try the DAX below.TableDifference = CALCULATE(SUM(CdmEtZKenR[Importo]);ALL(CdmEtZKenR)) - CALCULATE(SUM('CdmEtZKenR(2)'[Importo]);ALL('CdmEtZKenR(2)'))
Regards,
Lydia It's probably a filter issue, I can see you're trying to filter on just 2018 on that visual but we have no idea what you're doing on the other visuals, that we're using ALL is going to override it
19 Replies
- deepak91gResolver II
The best way is to use DAX. You can refere below post to refer a solution posted by Eric_Zhang
http://community.powerbi.com/t5/Desktop/Create-a-Calculated-Column-from-Different-Tables/td-p/60453P.S Accept this as solution if your query is solved
- jeoosmaHelper II
What I would is to create a field with difference between the total 1 and total 2.
- Greg_DecklerCommunity Champion
TableDifference = CALCULATE([Importo],ALL(Table1)) - CALCULATE([Importo],ALL(Table2))
Not sure what the table names are for Table1 and Table2 but substitute the right table names.
- Greg_DecklerCommunity Champion
So, the Total line in a table/matrix is whatever calculation is occurring with a filter of ALL. Therefore, you should be able to wrap your calculation in an ALL filter to get the same result that is being shown in your table Total line. Thus, if you want to subtract, you could create a measure like:
TableDifference = CALCULATE([SomeMeasure],ALL(Table1)) - CALCULATE([SomeOtherMeasure],ALL(Table2))