Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
JoeRobert06
Helper II
Helper II

Dynamic filter argument within table expression

PBI Community,

I have ran into a little hiccup with a report I have put together and am looking for some support. I have created a table with a DAX expression and am using this table to essentially replace my upper most parent table in my data model. I have incorporated a series of filter expressions in the table expression (see screenshot #1) that contains static values that allows me to reduce the overall context (number of rows). I am now attempting to improve the functionality of the report by changing these static values to dynamic however I am not getting the response I was looking for. I have create a few supporting tables (see screenshot #2, button #2) and have referenced these support tables in several ways, as filter arguments, and the table context just seems to reset to a larger number of rows; see screenshots #3 and #4 as reference.

I have used these technique before but within measures (not new DAX tables) so I am wondering whether I am seeing a limitation when try to embed variables/measures inside the table expression. Does anyone see anything wrong here that I am missing?

Thanks in advance for the support!

 

Screenshot #1

screenshot1_expression.png

 

 

 

 

 

 

 

 

 

 

Screenshot #2

screenshot2_model.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Screenshot #3

screenshot3_expression.png

 

 

 

 

 

 

 

 

 

 

 

 

Screenshot #4

screenshot4_expression.png

 

 

4 REPLIES 4
JoeRobert06
Helper II
Helper II

PBI Community,

I have ran into a little hiccup with a report I have put together and am looking for some support. I have written a table expression to create a custom table named "OE Troble Wells" and am essentially using this table to replace my upper most parent tables in my data model. I have incorporated a series of filter expression in the table expression (see screenshot #1) that contains static values that allows me to reduce the overall context (number of rows). I am now attempting to improve the functionality of the report by changing these static values to dynamic however I am not getting the response I was looking for. I have create a few supporting tables (see screenshot #2, button #2) and have referenced these support tables in several ways, as filter arguments, and the table context just seems to reset to a larger number of rows; see screenshots #3 and #4 as reference.

I have used these technique before but within measures (not new DAX tables) so I am wondering whether I am seeing a limitation when try to embed variables/measures inside the calculatetable / filter expression. Does anyone see anything wrong here that I am missing?

Thanks in advance for the support!

 

Screenshot #1

screenshot1_expression.png

 

 

 

 

 

 

 

 

 

 

Screenshot #2

screenshot2_model.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Screenshot #3

screenshot3_expression.png

 

 

 

 

 

 

 

 

 

 

 

 

Screenshot #4

screenshot4_expression.png

v-juanli-msft
Community Support
Community Support

Hi @JoeRobert06 

Calculated table doesn't support to change with dynamic values.

Maybe you could consider parameter in Power Query.

parameter in Power B

 

If you have any problem, pleas elet me know.

 

Best Regards

Maggie

Juanli

 

I got to thinking about this a little more and am wondering if you can provide clarity.

 

Please see below screenshot #1 as a reference. I have embedded measures into calculated tables before. Below I am generating a measure that is calculating a measure from the table in my previous post. If I was to go in and manually change the filter arguments for that table, the below calculated table "Support_time/cost outlier detection" is automatically adjusted as well. In my mind, I should be able to accomplish the same thing in my original post.

 

I think the issue here is that with my original example, i am wrapping the dynamic measure (or selection) with the filter function whereas my 2nd example, i am just simiply calling upon the dynamic measure as a constant value (not within a filter function).  For some reason, the filter function does not recognize this constant value and returns a "null" value.

 

I have found another linked below that is very similiar to my problem and so I am curious to see what the response will be (linked below).

 

Link - Post title: Help with dax filter function using measures as arguments

https://community.powerbi.com/t5/Desktop/Help-with-dax-filter-function-using-measures-as-arguments/m...

 

 

Screenshot #1

 

tableDAXexample.png

Thanks Juanli for the response!

 

I adjust the report so that I can adjust the original datasource with a parameter which will ultimately filter down my calculated table

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.