Forum Discussion
Anonymous
6 years agoNot applicable
Optimizing Dax formula
Workday Number = VAR CurrentMonth = SELECTEDVALUE ( 'Date'[Year Month] ) VAR MonthTable = FILTER ( ALL ( 'Date' ), 'Date'[Working Days] = "Weekday" && 'Date'[Year Month] = CurrentMonth ) RET...
- 6 years ago
Anonymous
I would venture it is because your RANKX function doesn't have the column reference to rank the values by. Include a column reference after the table reference:
RANKX ( MonthTable, MonthTable[...], CALCULATE ( AVERAGE ( Date[DayOfMonth] ) ),, ASC )
See if that works.
EDIT: you might also need an ALL or ALLSELECTED before the table expression, depending on the context you wish to calculate de Rank by:
RANKX ( ALLSELECTED(MonthTable), MonthTable[...], CALCULATE ( AVERAGE ( Date[DayOfMonth] ) ),, ASC )
v-eachen-msft
6 years agoCommunity Support
Hi Anonymous ,
Please make sure your table names are consistent, otherwise errors will occur. Change table name to either 'Date' or Date.