Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 Chain but imported from countries other than Chaina and called undirect counties.
Them tell me what the best chart should to use to show the amount for amount direct country and undirect countries.
Solved! Go to Solution.
Hello:
Please find report for you. I hope you mark as solution.
https://drive.google.com/file/d/1P8HqbFn_JnOfwBK8k2LxwmafGbMdhfTk/view?usp=sharing
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
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
Hi:
These are the calculated columns I sent earlier with the visual examples:
try this
Hello:
Please find report for you. I hope you mark as solution.
https://drive.google.com/file/d/1P8HqbFn_JnOfwBK8k2LxwmafGbMdhfTk/view?usp=sharing
@Whitewater100
Hello again,
I gave you before an example for specific country which is China.
How I can do that a dynamaic, for example, when I use slicer for any country in country of Origin, it give direct and undirect values for country of Import
An example of such calculations please.
Country of Origin | Country of Import | Amount |
China | China | 34 |
China | UAE | 3445 |
China | UAE | 5676 |
China | China | 6768 |
China | UAE | 342 |
China | KSA | 132 |
China | UAE | 323 |
Turkey | UAE | 234 |
China | Russia | 4545 |
China | India | 76 |
@dtxtreme
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
37 | |
25 | |
19 | |
14 | |
8 |
User | Count |
---|---|
69 | |
48 | |
44 | |
18 | |
15 |