Forum Discussion
Vickram
5 years agoHelper III
when passing the value returned from MAX function, the DAX returns incorrect output
I have a measure which calculates the current year: Current Year = YEAR(TODAY()). This returns 2020 and I can visualize it in a Card visual. Another measure to calculate max year in my data: Ma...
- 5 years ago
Vickram , Should have worked. Try this change and check
Max Forecast Year = MAXX(allselected(PopForecastTest),PopForecastTest[year])
Fowmy
5 years agoSuper User
Check the following modified measure:
Max Forecast year population =
VAR _MaxYear = [Max Forecast Year] return
CALCULATE(
SUM('PopForecastTest'[ForecastPop]),
FILTER(ALL(PopForecastTest[year]), PopForecastTest[year] = _MaxYear )
)
Simpler version:
Max Forecast year population =
VAR _MaxYear = [Max Forecast Year] return
CALCULATE(
SUM('PopForecastTest'[ForecastPop]),
PopForecastTest[year] = _MaxYear
)
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply š