Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Error in Calculate filter argument

Hello Team,   Today I have encountered strange issue that I can't understand. I have an AAS model where I created a measure: CALCULATE('Measures Table'[Spend],SELECTEDVALUE(Company[txt_country])=...
  • vapid128's avatar
    4 years ago

    https://docs.microsoft.com/en-us/dax/calculate-function-dax

     

    A Boolean expression filter is an expression that evaluates to TRUE or FALSE. There are several rules that they must abide by:

    • They can reference columns from a single table.
    • They cannot reference measures.
    • They cannot use a nested CALCULATE function.

    Beginning with the September 2021 release of Power BI Desktop, the following also apply:

    • They cannot use functions that scan or return a table unless they are passed as arguments to aggregation functions.
    • They can contain an aggregation function that returns a scalar value. For example,
      DAXCopy
       
      Total sales on the last selected date =
      CALCULATE (
          SUM ( Sales[Sales Amount] ),
          'Sales'[OrderDateKey] = MAX ( 'Sales'[OrderDateKey] )
      )

       

     

    That means

    CALCULATE('Measures Table'[Spend],SELECTEDVALUE(Company[txt_country])='Supplier Country'[txt_country])

    works fine because of the update.

     

    SSAS have not get the update yet.