\n
My Dax formula is below:
\nCalculated _Latest Year = CALCULATE(MAX('MyTable'[Year]),(ALLEXCEPT('MyTable','MyTable'[Country])))\n
\nPlease help me to fix this
\n","author":{"@type":"Person","name":"faisal"},"upvoteCount":0,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"I tested your dax formula and it works well. However here is another option that achieve the same goal:
\nLatest Year = \nVAR __country = 'Table'[Country]\nVAR __subTable = FILTER( 'Table', 'Table'[Country] = __country )\n\nReturn\n CALCULATE( MAX( 'Table'[Year] ), __subTable )\n
\n","author":{"@type":"Person","name":"Agustin Palacios"},"upvoteCount":1}}}Reputation: 60
I have created one calculated column to find the max by grouping the data by country. But my group by is not working. It is always finding the max of the year (2021) for all the country without considering the country column.
My table is below and expected result is in calculated _Latest Year
column :
My Dax formula is below:
Calculated _Latest Year = CALCULATE(MAX('MyTable'[Year]),(ALLEXCEPT('MyTable','MyTable'[Country])))
Please help me to fix this
Upvotes: 0
Views: 840
Reputation: 1204
I tested your dax formula and it works well. However here is another option that achieve the same goal:
Latest Year =
VAR __country = 'Table'[Country]
VAR __subTable = FILTER( 'Table', 'Table'[Country] = __country )
Return
CALCULATE( MAX( 'Table'[Year] ), __subTable )
Upvotes: 1