Forum Discussion
aliahad
1 year agoFrequent Visitor
Trying to get Max value using a column parameter
I have a table where I have added a column with an IF statment RowNumberYear = IF(VALUE(MAX('gt EMPLOYEE'[YEAR])) = VALUE('Head Count'[YEAR]), 1, 0) I am trying to get Max value using following...
Irwan
Super User
1 year agohello aliahad
as far as my knowledge, MAX() only accept column that has been defined.
DAX doesnt accept force command as my example above.
instead, you can do as below.
Hope this will help.
Thank you.
aliahad
1 year agoFrequent Visitor
Hi Irwan
The DAX expression you provided is giving me max value for all the rows.
Column = CALCULATE(
MAX('Head Count'[MONTH]),
FILTER('Head Count', 'Head Count'[RowNumberYear] = 1)
) So in my dataset I have YEAR and MONTH, and I trying to get 1 or 0 in the calculated column for max year and month, so the current max month I got in the dataset is 5 and current max year is 2025, but when I new data for June I want current max month = 6 and current max year = 2025 and next month the max month will be July. So I am trying to create a flag using the calculated column.
Thanks,
Ali.