Forum Discussion
Problem using measure as argumentes in FILTER function
Hi Anonymous
Are you sure it's not context transition playing tricks? Do bear in mind that every time you invoke a measure, the DAX engine wraps the call in a CALCULATE. That in your case would trigger context transition since you have a row context in FILTER( )
Thanks for your help!
I'm new to the DAX language, could you kindly send me an example of using the FILTER function with measure as an argument?
I am wanting to filter the row of a table to bring an argument to the media and filter another table with this measure.
- AlB7 years agoCommunity Champion
Anonymous
can you show the code of your measure?
- Anonymous7 years agoNot applicableYes for sure. I always select only one row of the table. Measure = VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT(‘Table1’[Colun1]) VAR __MAX_VALUES_TO_SHOW = 1 RETURN IF( __DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW; CONCATENATE( CONCATENATEX( TOPN( __MAX_VALUES_TO_SHOW; VALUES(‘Table1’[Colun1]); ’Table1’[Colun1]; ASC ); ’Table1’[Colun1]; ", "; ’Table1’[Colun1]; ASC ); ", etc." ); CONCATENATEX( VALUES(‘Table1’[Colun1]); ’Table1’[Colun1]; ", "; ’Table1’[Colun1]; ASC ) )
- AlB7 years agoCommunity Champion
Anonymous
Ok, that's a complex measure. Can you share the pbix? It'd be easier to help like that.
Otherwise you could try using the code of the measure directly in the filter argument instead of calling the measure. In that way you could partially check if it is a problem with the context transition derived from the implicit CALCULATE.