Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello,
I would like to count the occurence of the value of attribute1 = 'A', for each unique ID. Please see below:
ID | Attribute 1 | Attribute 2 |
1 | A | Y |
1 | A | Z |
1 | B | W |
2 | B | W |
2 | C | W |
3 | A | W |
Essentially, the output I am looking for is a measure that counts these occurences of 'A'. So for ID=1, the measure should equal 2. For ID=2, the measure should equal 0. For ID=3, the measure should equal 1.
Thanks in advance.
Ali
Solved! Go to Solution.
@aloosh89 Try this
Measure =
COUNTX (
FILTER (
'Table',
'Table'[Attribute 1] = "A"
),
'Table'[ID]
) + 0
Or
Measure =
CALCULATE (
COUNT ( 'Table'[ID] ),
'Table'[Attribute 1] = "A"
) + 0
@aloosh89 Try this
Measure =
COUNTX (
FILTER (
'Table',
'Table'[Attribute 1] = "A"
),
'Table'[ID]
) + 0
Or
Measure =
CALCULATE (
COUNT ( 'Table'[ID] ),
'Table'[Attribute 1] = "A"
) + 0
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
86 | |
84 | |
66 | |
62 | |
61 |
User | Count |
---|---|
199 | |
120 | |
110 | |
79 | |
69 |