Forum Discussion
Using measures in filter expression
- 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
ftf , QTD/Qtr based on selected date or today
QTD =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,Month(_max)))+1,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))