Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
HI Everyone
I cant seem to find a solution for this or rather how i could solve this using DAX.
So I have a table like this below.
How do I count the number of dogs based on he unique ID and would basically just result to 1.
so for ID 1 even though the dog kind appeared as 2 it should still count as 1 because of the unique ID.
Im sure its simple but i just dont know how to approach it with DAX. Thanks a lot in advance.
Solved! Go to Solution.
You can use an expression like this
Dogs = CALCULATE(DISTINCTCOUNT(Table[ID]), Table[Kind] = "Dog")
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@Anonymous , this will make sure it is correct for all kind
countx(summarize(Table[ID], Table[Kind]),[ID])
Only for dog'calculate(distinctCOUNT(Table[ID]),Table[Kind] = "dog")
You can use an expression like this
Dogs = CALCULATE(DISTINCTCOUNT(Table[ID]), Table[Kind] = "Dog")
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
thanks for quick reply I knew it was this simple
| User | Count |
|---|---|
| 51 | |
| 40 | |
| 29 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 64 | |
| 57 | |
| 40 | |
| 21 | |
| 19 |