Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
Here is a sample table like the one I am working with
Order Number - Type
1 A
1 A
2 B
3 A
Some order numbers repeat, but I would like to only count each order number once, AND count only instances with Type "A". The result I am looking for using the example table above is
Order Number - Count
1 1
2 0
3 1
I cannot add a column, so I have to use measures.
Thank you!
Solved! Go to Solution.
Hi there!
Try this:
CALCULATE(
DISTINCTCOUNT( OrderNumber ),
Type = "A"
)
Let me know if that helps!
Hi,
I am getting the error message below, as I cannot view it in any visual.
Can you share how you wrote the DAX code?
Sure, it is:
Is TranYN a measure?
Hi, Yes it is. Will this not work becaue of that?
I made that measure because there were many different values that count as a "Yes" (as well as many that count as a "no"), and I am not sure how to incorporate them all to be counted.
You should not use a measure there, you should use the column in your table. If you have a column where you are taking the "Yes" value, use that.
Not sure exactly what you mean with "many different values that count as a "Yes" "
I figured it out, thank you!
Hi there!
Try this:
CALCULATE(
DISTINCTCOUNT( OrderNumber ),
Type = "A"
)
Let me know if that helps!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
12 | |
10 | |
7 | |
7 |
User | Count |
---|---|
19 | |
14 | |
11 | |
10 | |
10 |