Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have a table with IDs that I would like to create a measure to count the IDs based on two criteria.
I want to count those IDs when the two criteria match
Example
If Criteria 1 & 2 are the same, then count how many IDs that fall into that criteria.
ID Criteria 1 Criteria 2
1 USA 12345678
2 USA 12345678
3 USA 12345678
Answer should be 3
Thanking you in advance
Joe
@Anonymous Please try this, it will work for both as a "New Column" or "Measure"
CALCULATE(COUNTROWS(Test03Count),ALLEXCEPT(Test03Count,Test03Count[Criteria1],Test03Count[Criteria2]))
Proud to be a PBI Community Champion
Measure = CALCULATE( CALCULATE(COUNT(test[Column1] ),test[Column2]="usa"),test[Column3]="12345678")
Thank you @Gokul
There is multiple matching criteria in the table. Not Only USA or 12345678, there could be Canada and 23456789 or Mexico and 345678910
The idea would be to count ids that fall into those criterias.
Kind regards
Joe
User | Count |
---|---|
97 | |
76 | |
76 | |
48 | |
26 |