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
mlbo
Regular Visitor

Filter corresponding columns

Hi

 

I have a matrix visual with account numbers as columns, journal numbers as rows and amounts as values, ex:

           1000     2000     3000    4000
101        10         -10        

102                      20        -20
103        35          -5         -30
104                      50                 -50

I have added a slicer for account number. When I filter on an account number, I want the matrix to show me the journal numbers with values on this account number, and also the corresponding account numbers/values. For example, if i filter on account number 3000, this is how I want the matrix to look like:

        1000   2000   3000
102                20     -20

103  35         -5       -30

I have tried using different measures, but they all seem to return only the account number I have filtered on. Help is highly appreciated 😄

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @mlbo 

 

You can try the following methods. Create a new slicer table.

Slicer = VALUES('Table'[account number])
Measure = 
Var _table=CALCULATETABLE(VALUES('Table'[journal number]),FILTER(ALL('Table'),[account number]=SELECTEDVALUE(Slicer[account number])))
RETURN
IF(SELECTEDVALUE('Table'[journal number]) IN _table,1,IF(SELECTEDVALUE(Slicer[account number])=BLANK(),1,0))

vzhangtinmsft_0-1726800626119.png

Is this your desired outcome? Please review the attachment.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi, @mlbo 

 

You can try the following methods. Create a new slicer table.

Slicer = VALUES('Table'[account number])
Measure = 
Var _table=CALCULATETABLE(VALUES('Table'[journal number]),FILTER(ALL('Table'),[account number]=SELECTEDVALUE(Slicer[account number])))
RETURN
IF(SELECTEDVALUE('Table'[journal number]) IN _table,1,IF(SELECTEDVALUE(Slicer[account number])=BLANK(),1,0))

vzhangtinmsft_0-1726800626119.png

Is this your desired outcome? Please review the attachment.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

That worked just the way I wanted! Thank you so much for helping me

Selva-Salimi
Super User
Super User

Hi @mlbo 

 

you should have a table for your journal numbers (lets call it DimJournal which contains all unique journal numbers) then you should use it as row of your matrix. then write a measure as follows:

 

measure val := var _selectedjournal = selectedvalue (DimJournal [Journal Id])

return

calculate (sum( your_table [value]) , filter (your_table , your_table [journal Id] = _selectedjournal))

 

** do not create any relationship between your table and Dimjournal

 

If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly.

Thank you for answering. I tried your solution, but the matrix still only shows the account number that is filtered on, and not the others. 

@mlbo 

 

there was a misunderstanding between account and journal. sorry for that. as you want to select an account so you should have account numbers as a unique table (lets call it DimAccount) and then you should use it as slicer. then write a measure as follows:

 

measure val := var _selectedjournal = selectedvalue (DimAccount [Account Id])

var _selectedjournal= summarize (filter (all(your_table) , Account in _selectedjournal) , your_table[journal])

return

calculate (sum( your_table [value]) , filter (your_table , your_table [journal Id] in _selectedjournal))

 

the columns of matrix should selected from your_table and there should not be any relation between these two tables.

 

If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly.

 

 

 

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.