Hello Power BI Community,
I am trying to write a dax column that calculates the COUNTROWS based on the categories in a different column. See the data at he end.
Column = (CALCULATE(COUNTROWS('tableName'),FILTER('tableName','tableName'[categories])))
name | categories | count |
c | blue | 10 |
y | blue | 10 |
y | blue | 10 |
v | blue | 10 |
i | blue | 10 |
o | blue | 10 |
r | blue | 10 |
f | blue | 10 |
a | blue | 10 |
t | blue | 10 |
r | orange | 9 |
f | orange | 9 |
a | orange | 9 |
t | orange | 9 |
g | orange | 9 |
c | orange | 9 |
y | orange | 9 |
y | orange | 9 |
v | orange | 9 |
a | red | 11 |
t | red | 11 |
g | red | 11 |
c | red | 11 |
y | red | 11 |
y | red | 11 |
v | red | 11 |
i | red | 11 |
o | red | 11 |
r | red | 11 |
f | red | 11 |
v | yellow | 10 |
i | yellow | 10 |
o | yellow | 10 |
r | yellow | 10 |
f | yellow | 10 |
a | yellow | 10 |
t | yellow | 10 |
g | yellow | 10 |
c | yellow | 10 |
y | yellow | 10 |
Solved! Go to Solution.
Hello @SriKandimalla ,
If I understand your issue, try this:
Countrows = CALCULATE(COUNTROWS(crow),ALLEXCEPT(crow,crow[categories]))
crow is my table name.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Hello @SriKandimalla ,
If I understand your issue, try this:
Countrows = CALCULATE(COUNTROWS(crow),ALLEXCEPT(crow,crow[categories]))
crow is my table name.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
User | Count |
---|---|
140 | |
65 | |
37 | |
34 | |
25 |
User | Count |
---|---|
142 | |
63 | |
41 | |
28 | |
23 |