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.
Thanks!
Solved! Go to Solution.
NOTES regarding original code:
1) FILTER is an iterator, and therefore requires RC (Row Context). As a result, its first argument must be a table, through which it can iterate. The problem here is that the first parameter in FILTER is not a table. Add it inside of VALUES function and the error should disappear.
- OLD: 'Issues (2)'[Category] --NOT A TABLE
- NEW: VALUES('Issues (2)'[Category]) --THIS FUNCTION RETURNS A TABLE
2) Additionally, the second parameter of COUNTX (the expression to count) is missing from the code. See commented code below.
COUNTX(
FILTER(
'Issues (2)'[Category], --FILTER is an iterator....Add VALUES function here
[Category]="CoC")
),
--EXP TO COUNT IS MISSING HERE
)
Hope this is helpful as well.
Regards,
Nathan
HI
Try this ==> Percentage CoC = COUNTX(FILTER('Issues (2)'[Category],[Category]="CoC"))
Thanks, but I'm still getting this error.
for your percentage use this code:
I used an open table on my pc. Adjust it to your table and fields names
I created my own PBIX to calculate the % of Tools in the below test table.
It works using the following 4 Measures:
Hopefully this helps!
Regards,
Nathan
NOTES regarding original code:
1) FILTER is an iterator, and therefore requires RC (Row Context). As a result, its first argument must be a table, through which it can iterate. The problem here is that the first parameter in FILTER is not a table. Add it inside of VALUES function and the error should disappear.
- OLD: 'Issues (2)'[Category] --NOT A TABLE
- NEW: VALUES('Issues (2)'[Category]) --THIS FUNCTION RETURNS A TABLE
2) Additionally, the second parameter of COUNTX (the expression to count) is missing from the code. See commented code below.
COUNTX(
FILTER(
'Issues (2)'[Category], --FILTER is an iterator....Add VALUES function here
[Category]="CoC")
),
--EXP TO COUNT IS MISSING HERE
)
Hope this is helpful as well.
Regards,
Nathan
Thanks,
I'm not sure what I'm dong wrong here, the number I should be getting is 166, but I'm only getting 1.
You're not doing anything wrong. You have successfully completed the 1st measure (Step 1).
COUNTX is counting 1 for each row WHERE [Category] = "CoC".
If you pull this measure onto a visual table that includes these records, you will find a 1 in the Measure column for all 166 CoC rows.
If you want it to show the TOTAL (in a card visualization) of all these 1's added together to make 166, you need to use a 2nd measure to SUM the results of the 1st measure.
Sum of CoC =
SUMX( --ITERATE THROUGH TABLE 'Issues 2'
'Issues 2',
[Count CoC] --SUMMING THE RESULTS OF MEASURE [Count CoC] (all the 1's added together)
)
Regards,
Nathan
Check out the November 2025 Fabric update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!