Forum Discussion
Anonymous
4 years agoNot applicable
How to distinct count with filter - counting measures
Hello, Im trying to create a bar chart that counts how many of my Items are either A, B or C I've tried the following fomula: CountA = COUNTROWS(FILTER('Table', [Chart] = "A" )) CountB...
- Anonymous4 years ago
Hi Anonymous ,
Oh ,got it!
I built another data sample :
And the [Chart] is a measure not column:
Chart = IF(MAX('Table'[Column1])>10,"A","B")Then please try:
Count A = var _t=SUMMARIZE('Table',[Index],"Chart",[Chart]) return COUNTROWS(FILTER(_t,[Chart]="A"))Count B = var _t=SUMMARIZE('Table',[Index],"Chart",[Chart]) return COUNTROWS(FILTER(_t,[Chart]="B"))Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Hi Anonymous ,
If you want to calculate the count of each Chart, I have done it in two ways, please check.
1. Use the summarize type of "Count":
2. Create a Count measure:
Count Measure = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Chart]) )
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
No luck unfortunetly. But to add more context 'Chart' is a measure calculated by an if statement i.e. if [value] > 10, "A" , "B"