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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello
I want to do a calculation:
CALCULATE(COUNTROWS(Table1),Table1[Column2]=Table2[Column1])
However it says the expression can only contain one column. Is there any workaround for this?
For example Table1:
1, A
2, B
3, C
Table2:
A
B
C
I want to count the rows of Table1 using as criteria Table1[Column2]=Table2[Column1] instead of hardcoding the criteria as Table1[Column2]="A" etc
Thanks
Hi @Anonymous ,
Is this problem solved?
If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If not, please let me know.
Best Regards,
Icey
Hi, unfortunately it is not solved. I get multiple errors of different types.
@Anonymous , In case they join on the same column you do not need that
else try
CALCULATE(COUNTROWS(Table1),filter(Table1,Table1[Column2]=max(Table2[Column1])))
CALCULATE(COUNTROWS(Table1),filter(Table1,Table1[Column2]=related(Table2[Column1])))
Row context need to forced using values or summarize when you check data above the match level
CALCULATE(COUNTROWS(Table1),filter(Table1,Table1[Column2]=max(Table2[Column1])),values(Table1[Column2]))
@Anonymous
I changed your sample data because all the three letters can be found in both tables.
Then I will find how many letters in table 1 can be found in table 2
Measure 2 =
VAR TBL=ADDCOLUMNS(SUMMARIZE(Table1,Table1[index],Table1[letter]),"MATCH",LOOKUPVALUE('Table2'[LETTER],Table2[LETTER],'Table1'[letter]))
VAR tbl2=FILTER(TBL,[MATCH]<>"")
return COUNTROWS(tbl2)
hope this is helpful.
Proud to be a Super User!
@Anonymous ,
Try the below DAX:
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.