cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IgorCT Frequent Visitor
Frequent Visitor

Problem using measure as argumentes in FILTER function

I am new here,

I would like help solving a problem! I'm trying to filter a table passing to a measure's FILTER function, but it does not return values, when I substitute the same measure for "text" values ​​return correctly.

 

Summarized Table = FILTER (OriginalTable; OriginalTable [field1] = "TEST")    -   OK

 

Summarized Table = FILTER (OriginalTable; OriginalTable [field1] = [measurement returning "TEST"])      -     NOK

13 REPLIES 13
Super User
Super User

Re: Problem using measure as argumentes in FILTER function

Hi @IgorCT

 

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( )

IgorCT Frequent Visitor
Frequent Visitor

Re: Problem using measure as argumentes in FILTER function

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.

 

 

 

Super User
Super User

Re: Problem using measure as argumentes in FILTER function

@IgorCT

 

can you show the code of your measure?

Highlighted
IgorCT Frequent Visitor
Frequent Visitor

Re: Problem using measure as argumentes in FILTER function

Yes 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 ) )
Super User
Super User

Re: Problem using measure as argumentes in FILTER function

@IgorCT

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.

Super User
Super User

Re: Problem using measure as argumentes in FILTER function

@IgorCT

 

What table are you doing the FILTER( ) operation on?  The Table1 you are referring to in the measure??

 

IgorCT Frequent Visitor
Frequent Visitor

Re: Problem using measure as argumentes in FILTER function

Thanks for everything!

I want to display in the table aux the selected item in the filter table.

 

image.pngimage.png

Super User
Super User

Re: Problem using measure as argumentes in FILTER function

@IgorCT

 

Can you share the pbix file itself? With dummy data if there's confidential stuff on it.

Have you tried to use the code for the measure directly in the filter condition instead of calling the measure?

 

 

IgorCT Frequent Visitor
Frequent Visitor

Re: Problem using measure as argumentes in FILTER function


I do not have clever information in this article. How can I send it to you?

I'm basically trying to filter a table with filter info without they are interconnected.

 

 

Thank you very much in advance.

 

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 288 members 3,051 guests
Please welcome our newest community members: