Forum Discussion
TOP 10 countries using DAX code
- 4 years ago
Anonymous it should work :))
What is [Att_Value1]? Is that a column or a measure?
- 4 years ago
Anonymous no worries 🙂
This is for the scenario where the total is for all (just change it to your names and 10 instead of 3):Top 3 Countries By Sales = VAR _countries = TOPN(3, ALLSELECTED(Customer[Country]),[Sales Amount]) RETURN IF( ISINSCOPE(Customer[Country]), CALCULATE( [Sales Amount], KEEPFILTERS(_countries) ), [Sales Amount] )
its same, I know you sae different name in code and visual, but its same the coulm and measure.
SpartaBI
Anonymous it should work :))
What is [Att_Value1]? Is that a column or a measure?
- Anonymous4 years agoNot applicable
Its worked. So Sorry I had a mistake. I will Accept your solurtions.
I have another Question:
If I want to show top 10 countries and show me the grand total of each country out of all countries ( I dont want to give the grand total of Top 10 countries only).- SpartaBI4 years agoCommunity Champion
Anonymous no worries 🙂
This is for the scenario where the total is for all (just change it to your names and 10 instead of 3):Top 3 Countries By Sales = VAR _countries = TOPN(3, ALLSELECTED(Customer[Country]),[Sales Amount]) RETURN IF( ISINSCOPE(Customer[Country]), CALCULATE( [Sales Amount], KEEPFILTERS(_countries) ), [Sales Amount] )