Forum Discussion
Anonymous
4 years agoNot applicable
Dax Aggregation for Country level
Hai All, I need one help on this The above table % Share range is the expecting output I want to achieve this logic at the Dax level Users want to see the % total at the country level For...
- 4 years ago
Hi Anonymous
Please use the following code
% Share Range = VAR Numerator = [# Model Number] VAR T1 = CALCULATETABLE ( Initiative, ALLEXCEPT ( Initiative, Initiative[Country] ) ) VAR T2 = SUMMARIZE ( T1, Initiative[Country], Initiative[Category] ) VAR T3 = ADDCOLUMNS ( T2, "Models", [# Model Number] ) VAR Denominator = SUMX ( T3, [Models] ) RETURN IF ( HASONEVALUE ( Initiative[Country] ), DIVIDE ( Numerator, Denominator ), 1 )
themistoklis
4 years agoCommunity Champion
Hello Anonymous
Create a new measure and add the following formula:
% Share =
VAR Volume =
SUM('Table'[Model Number])
VAR AllVolume =
CALCULATE ( SUM('Table'[Model Number]),ALLSELECTED('Table'[Category]) )
RETURN
DIVIDE ( Volume, AllVolume )
Fie also attached