Forum Discussion
Connect measure to a Filter
hi team!
I have a dashboard with a Filter (a list of names).
I need a measure that count the list of names of the same column EXCEPT the one selected on the filter. Is it posible to do so?
Hi , geroagostini
According to your description, you want to filter in a slicer and you need to get the count of the names except the slicer selected.
Here are the steps you can refer to :
(1)This is my test data:(2)We can create a measure like this:
If you just want to show the count of the excepted data , you can use this dax:Except Count = var _total = COUNTX( ALL('Table'[Name]),[Name]) var _selected = COUNTROWS( VALUES('Table'[Name])) return _total-_selectedIf you want to sshow the name of the excepted data , you can use this dax:
Except Count Name = var _total = ALL('Table'[Name]) var _selected = VALUES('Table'[Name]) var _expect_table = EXCEPT(_total,_selected) return CONCATENATEX(_expect_table,[Name],",")(3)Then we can put the fields we need on the visual and we can meet your need:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
1 Reply
- v-yueyunzh-msft
Community Support
Hi , geroagostini
According to your description, you want to filter in a slicer and you need to get the count of the names except the slicer selected.
Here are the steps you can refer to :
(1)This is my test data:(2)We can create a measure like this:
If you just want to show the count of the excepted data , you can use this dax:Except Count = var _total = COUNTX( ALL('Table'[Name]),[Name]) var _selected = COUNTROWS( VALUES('Table'[Name])) return _total-_selectedIf you want to sshow the name of the excepted data , you can use this dax:
Except Count Name = var _total = ALL('Table'[Name]) var _selected = VALUES('Table'[Name]) var _expect_table = EXCEPT(_total,_selected) return CONCATENATEX(_expect_table,[Name],",")(3)Then we can put the fields we need on the visual and we can meet your need:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly