cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dennes
Frequent Visitor

To filter or not to filter, that's the question

Hi,

 

I have two tables, A and B, parent and child.

 

Table A is on a slicer, table B is on a Matrix.  Table B has a measure using table A on the expression, It's this:

 

NumFilter = IF(CONTAINS('Selector Table';[Number];'Super5'[Number]);1;0)
 
('Selector Table'=A; 'Super5' =B)
 
The problem is: When I select something on the slicer, table B is visually filtered according to the slicer and the measure is calculated according to the filtered slicer (filtered table A).
 
The measure is correct, that's what I want, but I don't want the direct visual filter, I have other plans for filtering.

Already tried two options: disable interactions on the visual and breaking the relationship. Both options apply for both situations, totally breaking the result.
 
I also tried VALUES inside the contains, no result. 

So: How to make the measure use the table A filtered according to the slicer without visually filtering table B?
 
Thank you!
2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

Very difficult to say without sample data to play with, but perhaps disconnect your slicer table from your other table and use VALUES in a VAR.

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Dennes
Frequent Visitor

Hi,

 

I found the problem.

 

On the first message, I said I had a measure, but it was not true: it was created as a calculated column, not measure. My mistake.

 

As soon as I converted it to a measure, it became able to get the filtered data from another table using the previous information, about creating a var inside the expression.

 

Regards,

 

Dennes

 

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

Very difficult to say without sample data to play with, but perhaps disconnect your slicer table from your other table and use VALUES in a VAR.

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Hi, Greg,

 

Thank you for the suggestion. I tried, didn't work, no difference in the result.

 

Regards,

 

Dennes

 

Dennes
Frequent Visitor

Hi,

 

I found the problem.

 

On the first message, I said I had a measure, but it was not true: it was created as a calculated column, not measure. My mistake.

 

As soon as I converted it to a measure, it became able to get the filtered data from another table using the previous information, about creating a var inside the expression.

 

Regards,

 

Dennes

 

Helpful resources

Announcements
Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Ignite 2022

What's Next at Microsoft Ignite 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Top Solution Authors