Forum Discussion
Gopinath_iyer
4 years agoHelper II
Calculated column
Hello Friends, Can you help me with the below calculation, I want to create a new column "B" based on existing column "A". A B Desktop 4 Desktop 4 Desktop 4 Desktop 4 ...
- Anonymous4 years ago
Hi Gopinath_iyer ,
It seems that you want to calculate the row count of each A and each Country, right?
Please try:
B = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[A],'Table'[Country]))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.
vojtechsima
4 years agoSuper User
Gopinath_iyer
I see, makes sense.
Here you go:
New B =
var currentGrouop = 'Table'[A]
return COUNTROWS(FILTER('Table', 'Table'[A] = currentGrouop))Gopinath_iyer
4 years agoHelper II
Thanks a lot its working...but it missed the country filter...can you suggest?.
| A | Country | B |
| Desktop | US | 3 |
| Desktop | US | 3 |
| Desktop | US | 3 |
| Desktop | UK | 1 |
| Laptop | US | 1 |
| Laptop | UK | 1 |
| IPAD | UK | 2 |
| IPAD | UK | 2 |
| IPAD | US | 1 |