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
NenadV
Helper III
Helper III

Slicer does not filter visual

I have data model with three tables:

model.png

and here is data from these tables:

data.png

and now I want to create report with one slicer with nameA values, and one table, with nameB column and number of rows in table C, so I created measure: Measure = COUNTROWS(Table C) + 0 (I added +0 at the end because I want to show 0 instead of BLANK when there are no rows in Table C that match selection). Something like this:

report.png

and here is the problem, when I select some value from slicer, "a" for example, this is what I get:

report2.png

but that is not what I expected, I just want to see: 

a0
aa1
aaa2

So  slicer is filtering values from table C and counting them but it does not filter nameB column values.

I tried removing +0 from the measure and now it is returning just

a 
aa1
aaa2

as expected.

Can someone please explain me what is happening here, and how I can get wanted result.

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

You can try doing 

Measure = SUMX(TableB, 0 + COUNTROWS(C))

 

Adding +0 to a measure can act as a cross join or clear filters when multiple table relationships are involved. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

3 REPLIES 3
BA_Pete
Super User
Super User

Kudo'd OP for a really well-presented and clear request. An example of how help requests should look!

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




AllisonKennedy
Super User
Super User

You can try doing 

Measure = SUMX(TableB, 0 + COUNTROWS(C))

 

Adding +0 to a measure can act as a cross join or clear filters when multiple table relationships are involved. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thank you very much @AllisonKennedy , you helped me a lot. Your solution is working well.

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.