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
dpetrancuri
Frequent Visitor

Dynamic Propagation of Filter Columns with values from current Row context?

Assume a matrix with two rows defined in the visualization pane. They are DimA.Name and DimB.Name

Let's assume a measure X which is used in the matrix.

Let's further assume measure X is being invoked for a total row in the matrix.

Let's assume as part of the measure, I need to determine a count of the number of rows (OUTER rows) from some table expression where there are no rows from a prior period (INNER rows) corresponding to the same filter conditions (NOT filter values) as were used to filter the the OUTER rows. 

I do not want to assume a static use case for Measure X as I am building a BIaaS platform and want the ability to allow the power user to potentially use this measure in a variety of different contexts, but based upon the context, I want to be able to filter the INNER rows using the columns corresponding to the filters (or some subset there of) that the OUTER rows were filtered on. 

So in essence I'm basically saying I want to filter the INNER rows on the same COLUMNS used to to filter the OUTER Rows but with the VALUES of the current OUTER row without any specific coding for literal column references.

 

Stated another way, I want to propagate the filter context COLUMNS of the OUTER rows onto the INNER rows but with the VALUES from the OUTER row, not the SELECTEDVALUE of a specific filters.

 

I hope the @AlbertoFerrari or @marcorusso or @AmirNetz  might have some thought on this?

Thank you for your consideration.

Respectfully.

 

Darryll Petrancuri

4 REPLIES 4

Unfortunately, there is no way to obtain what you need. In a measure, you cannot read the current structure of the query.

In MDX it was possible, albeit a bit complicated. In DAX, there is no such option.

 

Alberto

Alberto Ferrari - SQLBI

I was afraid of that Alberto.

I gather you understand the use case? Short of brute force hard coding, do you have any thought on how you might approach this, and if not, do you think there's a case that can be made for this being considered a worthwhile feature to be added to the DAX language?

Respectfully and With Gratitude,

Darryll Petrancuri

The use case is very common, indeed. Unfortunately, it is not supported, yet. What would be needed is a sort of language at the visual level, so to be able to read "rows and columns" from the visual, instead of the source data model. DAX can be extended in that sense, we will make a proposal soon about such a feature, stay tuned.

Nevertheless, on the short-term, there is nothing available apart from brute force coding which, as you might easily guess, leads to very poor performance.

Alberto Ferrari - SQLBI

I have a few thoughts about how this could be implemented in the engine, but I'm sure you and Marco have many as well.

This would be interesting to have a DAX user focus group to socialize the use cases and discuss how people would benefit by being able to access the visual filter context and apply that visual filter context as a modifier to a nested CALCULATE.

 

Thanks for your reply and consideration.

 

Respectfully,

 

Darryll Petrancuri

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.