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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Filtering columns of a dynamic matrix

Dear Community,

 

I have the following challenge I cannot master:

My fact table contains transactions, defined by their idividual transaction IDs. The table also contains the columns Program and process to define which program and which process within that program the transaction belongs to.

 

Each transaction can has a number of referenes which are listed in a related dimension table. Each reference has the related transacion ID as well as a a reference type and a value. The refernce types are specific to the certain processes the transaction belongs to.

 

When I create a matrix with the transactions IDs as rows, the refrence types as columns and the reference values as values, the number of columns differ depenting on the programs/processes I filter the matrix via slicers. As new reference types can be added in the source, I cannot predict the columns in advance.

I now want to user to be able to filter the matrix, so that only these transactions are shown that contain the set of reference values the user defined.

My attempt for this was to create a sencond matrix with only the refence types and values that do not slice the main matrix, to create a form of selector. The SUMMARIZE funtion would then let me collect all selected values for all reference type. Unfortunatly I cannot find a solution to write a dynamic function to filter the transactions with these information as there is no such thing like the INDIRECT funtion in excel.

So my question is: Is there any option in DAX to write such a dynamic function? Or is there another way to filter a dynamic matrix as descripted?

Thanks in advance for your input.

2 REPLIES 2
Anonymous
Not applicable

Hi @Greg_Deckler 

thanks for your answer.

Let's say my fact table looks like this:

Transaction IDProgramProcess
123456Program AProcess A-1
123457Program BProcess B-3
123458Program AProcess A-2
123459Program BProcess B-1
123460Program CProcess C-1
123461Program CProcess C-1
123462Program CPrcoess C-3
123463Program BProcess B-2
123464Program AProcess A-2
123465Program AProcess A-1

 

and my dimension table looks like this:

Reference IDTransaction IDReference typeReference value
r456789123456customer_IDc-abc
r456790123456reason_for_callingcomplaint
r456791123456solution10% discount
r456792123457order_nrON-4587
r456793123457type_of_changecancellation
r456794123458customer_IDc-xyz
r456795123458invoice_nrINV-896
r456796123459order_nrON-3689
r456797123460departmentSales
r456798123460item_categorieIT accessoiries
r456799123460itemkeyboard
r456800123460amount10
r456801123461departmentCustomer Support
r456802123461item_categorieoffice supplies
r456803123461itemwriting pad
r456804123461amount150
r456805123462departmentSales
r456806123462parking_lotA10
r456807123462day09/19/2023
r456808123463order_nrON-3689
r456809123464customer_IDc-abc
r456810123464invoice_nrINV-748
r456811123465customer_IDc-xyz
r456812123465reason_for_callingquestion regarding order
r456813123465solutionanswer given


a matrix with the Transactions IDs as rows and Reference types as columns would look like this:

Transaction IDcustomer_IDreason_for_callingsolutionorder_nrtype_of_changeinvoice_nrdepartmentitem_categorieitemamountparking_lotday
123456c-abccomplaint10% discount         
123457   ON-4587cancellation       
123458c-xyz    INV-896      
123459   ON-3689        
123460      SalesIT accessoirieskeyboard10  
123461      Customer Supportoffice supplieswriting pad150  
123462      Sales   A1009/19/2023
123463   ON-3689        
123464c-abc    INV-748      
123465c-xyzquestion regarding orderanswer given         

 

I put slicers on the site to filter by Program and/or Process. So lets say the user slices to only Process "A-1", the matrix would be:

Transaction IDcustomer_IDreason_for_callingsolution
123456c-abccomplaint10% discount
123465c-xyzquestion regarding orderanswer given

 

I'm searching for a solution for the user to filter this matrix even further by column. For example in this case the user only wants to see all transaction for the customer ID "c-abc", or even a combination of costumer_ID = "c-abc" and reason_for_calling = "complaint".
I would like the matrix then to show all rows that match this condition including all columns for these rows (also the ones not filtered by the user).

Greg_Deckler
Community Champion
Community Champion

@Anonymous Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.