Forum Discussion

ftf's avatar
ftf
New Member
4 years ago
Solved

Using measures in filter expression

Hello Community,   I'm new to PowerBi and currently wondering about how the filter in CALCULATE works. I have a column "ColumnA" which is part of "Table1" that should be filtered and returned. The...
  • v-cazheng-msft's avatar
    4 years ago

    Hi ftf,

     

    Just the error said, you have used a TRUE/FALSE expression as a table filter expression. This is not allowed. You could refer to this official doc to learn what kind of filters can be used as the parameters of CALCULATE function: CALCULATE function (DAX) - DAX | Microsoft Docs

     

    In addition, you need make some changes to your Measure formula.

    CalculationOnFilters =
    CALCULATE (
        SUM ( Table1[ColumnA] ),
        FILTER (
            Table1,
            'Table1'[Category]
                IN { "A" }
                    && 'Table1'[Quarter] IN { VALUE ( 'Table2'[current_quarter] ) }
        )
    )
    //CALCULATE(SUM(Table1[ColumnA]),'Table1'[Category] IN { "A" },'Table1'[Quarter] IN {VALUE('Table2'[current_quarter]) })
    
    

    With the sample data created, the result looks like this.

     

    Also, attach the pbix file as reference. Hope it helps.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

     

    Best Regards,

    Community Support Team _ Caiyun