Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
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.
@Anonymous
can you show the code of your measure?
@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.
@Anonymous
What table are you doing the FILTER( ) operation on? The Table1 you are referring to in the measure??
Thanks for everything!
I want to display in the table aux the selected item in the filter table.
@Anonymous
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?
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.
@Anonymous
You can place the file on platforms like Dropbox, OneDrive, etc. or upload it to sites like this (no sign-in required) and then share the URL here.
First of all I would like to thank you for your help and availability. Follow the file link.
Thanks for everything!
One more question, can I use SELECTEDVALUE inside the FILTER function to return a filtered table with the context value? As below.
Aux Table = FILTER(Table2;Table2[Col1] = SELECTEDVALUE(Table1[Cod];""))
I tried more does not return any value.
You may want to look at ALLSELECTED, in case the filter is multiple:
CALCULATE(Table1;ALLSELECTED(Table2[Col]))
I recommend you to follow Introduction to DAX Course by SQLBI guys, Marco and Alberto. You will have really good insights into it.
In this case, there is a video explaining ALLSELECTED in detail within Evaluation Context Section of the course.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |