The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
ID | Col 2 |
1 | N |
1 | N |
1 | Y |
2 | N |
2 | N |
3 | Y |
3 | Y |
3 | Y |
4 | N |
4 | N |
4 | Y |
4 | N |
5 | N |
Note that Group ID 1 has at least one "Y" so count 1. Group ID does not have a "Y" so no count. 3 has all "Y" so count 1. 4 has all N but at least one "Y" so Count 1. 5 has no "Y" so no count.
In total my measure should provide me a count of 3.
Solved! Go to Solution.
Hi @user35131 ,
Here are the steps you can follow:
1. Create measure.
Count Group ID =
var _table=SUMMARIZE('Table','Table'[ID],"1",CALCULATE(COUNT('Table'[Col 2]),FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])&&'Table'[Col 2]="Y")))
return
COUNTX(FILTER(_table,[1]>=1),[ID])
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @user35131 ,
Here are the steps you can follow:
1. Create measure.
Count Group ID =
var _table=SUMMARIZE('Table','Table'[ID],"1",CALCULATE(COUNT('Table'[Col 2]),FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])&&'Table'[Col 2]="Y")))
return
COUNTX(FILTER(_table,[1]>=1),[ID])
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
I'm also getting the unique count without the condition if it has more than one distinct value.
Hi @user35131
You can use the following measure to achieve the output you want.
Measure =
VAR _1 = COUNTROWS ( FILTER ( DISTINCT ('Table'[ID] ) , DISTINCTCOUNT ('Table'[Col 2] ) > 1 ) )
RETURN
_1
Hope this helps and all the best!
Theo 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Even though it doesn't reference the "Y" in the code it will work?
@user35131 it returns anything with more than one distinct value. Give it a go and let me know how it goes 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
I'm getting the unique count without the condition that there is at least one distinct count.
@user35131 Did you add Client ID and then the measure to a table?
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
247 | |
122 | |
110 | |
77 | |
72 |