Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count only Code  A and B if it is same in any ID

Hi Team,

 

I am trying to count only Code  A & B if it same in any ID , any thoughts 

 

 

ID Code
1002A
1002B
1002C
1003A
1003D
1003C
1004A
1004B
1005A
1005C
1005D

 

idABCD
1002111 
10031 11
100411  
10051 11

 

Result will be 2 as a count , A & B  for 1002 & 1004 as per criteria

2 ACCEPTED SOLUTIONS
ValtteriN
Super User
Super User

Hi,

I am not sure I fully understood, but try something like this:


Count A/B =
IF(
COUNTROWS(
    FILTER(
        'Table (7)','Table (7)'[Code]="A" || 'Table (7)'[Code]="B"))>1,1,0)

ValtteriN_0-1661237165669.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Anonymous
Not applicable

Hello

 

Please try this measure

JamesFr06_0-1661237304700.png

Mesure =
var idrech=SELECTEDVALUE(Feuil3[ID ])
var step_1=filter(SUMMARIZE(Feuil3,Feuil3[ID ],Feuil3[Code]),Feuil3[Code] in {"A","B"})
var result =countrows(step_1)
return
if (result>1, result)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hello

 

Please try this measure

JamesFr06_0-1661237304700.png

Mesure =
var idrech=SELECTEDVALUE(Feuil3[ID ])
var step_1=filter(SUMMARIZE(Feuil3,Feuil3[ID ],Feuil3[Code]),Feuil3[Code] in {"A","B"})
var result =countrows(step_1)
return
if (result>1, result)
Anonymous
Not applicable

Thanks it working correctly.

ValtteriN
Super User
Super User

Hi,

I am not sure I fully understood, but try something like this:


Count A/B =
IF(
COUNTROWS(
    FILTER(
        'Table (7)','Table (7)'[Code]="A" || 'Table (7)'[Code]="B"))>1,1,0)

ValtteriN_0-1661237165669.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Amazing approach , Could you please add 1 more thing how can display 1 ( which are matching) by DAX in same Measures

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.