Forum Discussion

dniedrauer's avatar
dniedrauer
Icon for Resolver I rankResolver I
8 years ago
Solved

A function filter has been used in a true/false statement that is used as a filter expression....

I thought the filter function was supposed to get around this error. Ugh. Here is my formula. BTW 'year' is formatted as a number.    calculate(distinctcount(Main[Vessel Imo]),filter(all('Calendar'...
  • Abduvali's avatar
    8 years ago

    Hi dniedrauer,

     

    Try the same formula but remove column name after ALL:

    • calculate(distinctcount(Main[Vessel Imo]),filter(all('Calendar'),'Calendar'[Year]=max('Calendar'[Year]))

    Or as an alternative, you can create Current Year column and compare it against the Calendar Year something like this:

    • Measure 3 = CALCULATE(DISTINCTCOUNT(Sheet1[Item_Rev]),FILTER(ALL(Sheet1),YEAR(Sheet1[Date])=MAX(Sheet1[Year])
      ))

     

    Hope it helps.

     

    Regards

    Abduvali