Forum Discussion
DAX Count Question
- 3 years ago
grayscg maybe this measure will do it:
Count = VAR __checkCount = 2 RETURN SUMX ( SUMMARIZE ( Test, Test[CustomerID], "@Count", COUNTROWS ( Test ) ), IF ( [@Count] >= __checkCount, 1 ) )✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
grayscg I can try to explain what is going on but you can surely explore it further
SUMMARIZE -> is creating a table, basically getting count by customer id
SUMX -> is outer function iterating over a table produced by SUMMARIZE and then checking if count >= 2 then return 1 else blank () and it summing up all the 1's
I hope this detail is helpful but ofcourse you need to learn more about when and how to use these functions. Good luck!
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.