Forum Discussion
Anonymous
5 years agoNot applicable
DAX Newbie Question
If SQL -
;WITH cte (Territory, Populaton)
AS (SELECT [SalesTerritory] AS 'Territory',
SUM([LatestRecordedPopulation]) AS 'Population'
FROM [WideWorldImporters].[Application].[StateProvinces]
GROUP BY SalesTerritory
)
SELECT MAX(Populaton) FROM cte
Then DAX -
EVALUATE
SUMMARIZE(States,States[Territory],"Population",SUM(States[Population]))
SUMMARIZE(States,States[Territory],"Population",SUM(States[Population]))
Works as expected
How do I ...?
DEFINE VAR cte = SUMMARIZE(States,States[Territory],"Population",SUM(States[Population]))
EVALUATE max(cte[Population])
EVALUATE max(cte[Population])
About 1/2 way through Ferrari & Russo, and climbing Everest!
EVALUATE { MAXX ( cte, [Population] ) }
The curly braces are table constructor syntax, since a DAX query must return a table.
In a measure, you could return the scalar value MAXX ( cte, [Population] ).
Regards,
Owen
2 Replies
- OwenAuger
Super User
EVALUATE { MAXX ( cte, [Population] ) }
The curly braces are table constructor syntax, since a DAX query must return a table.
In a measure, you could return the scalar value MAXX ( cte, [Population] ).
Regards,
Owen
- amitchandak
Super User
Anonymous , Try like
EVALUATE maxX(cte, cte[Population])
You might have force a row
EVALUATE row("Result", maxX(cte, cte[Population]))