Forum Discussion
Count if as a Measure
- Anonymous2 years ago
Thanks the solution from MattAllington , and your solution is great.
Hi, Jsummers
Pls is your current problem solved? I went through your reply to Matt Allington. If you don't want your measure to be affected by other columns, you can use the ALLEXCEPT function. I created a sample as follows:
I use the following DAX expression:
Count = CALCULATE(COUNTA('Table'[BusID]),ALLEXCEPT('Table','Table'[BusID]))This will remove the other filters and leave only the BusID filter. Here are the results:
When I add the id column to the visual, it doesn't affect the calculation of the Count measure. If you are not familiar with this function, you can click on the link below to learn it:
ALLEXCEPT function (DAX) - DAX | Microsoft Learn
I've provided the PBIX file used this time below.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks the solution from MattAllington , and your solution is great.
Hi, Jsummers
Pls is your current problem solved? I went through your reply to Matt Allington. If you don't want your measure to be affected by other columns, you can use the ALLEXCEPT function. I created a sample as follows:
I use the following DAX expression:
Count = CALCULATE(COUNTA('Table'[BusID]),ALLEXCEPT('Table','Table'[BusID]))
This will remove the other filters and leave only the BusID filter. Here are the results:
When I add the id column to the visual, it doesn't affect the calculation of the Count measure. If you are not familiar with this function, you can click on the link below to learn it:
ALLEXCEPT function (DAX) - DAX | Microsoft Learn
I've provided the PBIX file used this time below.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your help, this has worked and giving me the expected result.