Forum Discussion
Anonymous
4 years agoNot applicable
How to sum two thing
Hello expoerts, I want from example belllow to tell me the dax code that calculate: - the amount orginated from Chaina and imported from Chaina and called the direct & amount that orginated from ...
- 4 years ago
Hello:
Please find report for you. I hope you mark as solution.
https://drive.google.com/file/d/1P8HqbFn_JnOfwBK8k2LxwmafGbMdhfTk/view?usp=sharing
- Anonymous4 years ago
Hi Anonymous ,
Here are the steps you can follow:
1. Use Enter data to create a table.
2. Create measure.
direct country = CALCULATE(SUM('Table'[Amount ]),FILTER(ALL('Table'),'Table'[Country of Origin ]="China"&&'Table'[Country of Import ]="China"))undirect countries = CALCULATE(SUM('Table'[Amount ]),FILTER(ALL('Table'),'Table'[Country of Origin ]="China"&&'Table'[Country of Import ]<>"China"))Measure = SWITCH( TRUE(), MAX('Table2'[Group])="direct country",[direct country], MAX('Table2'[Group])="undirect countries",[undirect countries])3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Whitewater100
Solution Sage
4 years agoHi:
These are the calculated columns I sent earlier with the visual examples:
Direct(org & Imp China) = IF(AND(Data[Country of Origin ] = "China", Data[Country of Import ] = "China"), Data[Amount ])
Origin China-Import Not China = IF(AND(Data[Country of Origin ] = "China", Data[Country of Import ] <> "China"), Data[Amount ])