Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I am using trying to use the CountRows function in an expression to show all selected values of a parameter in a Paginated Report
The function I have seen online from others is: IIF(COUNTROWS("Table1") = (Parameters!Table1.Count), "All", JOIN(Parameters!Table1Supplier.Value, ", "))
However this yields an error "Object reference not set to an instance of an object".
When I try to break down the expression, I can use =COUNTROWS("Table1") to get a value. But when I try to add anything else to this expression, the error gets thrown. If I try, =IF(COUNTROWS("Table1") > 1..... this is an error. If i try, =2+COUNTROWS("Table1"), this is an error.
Can anyone help?
Hi @kmei001 ,
I have tested and this works for me, can you share more detail about this, what is the error when IF(COUNTROWS("Table1") > 1?
Best Regards
Community Support Team _ chenwu zhu
Hi @kmei001
That's not a formula for Power BI. Might be Access? Might be SSRS? Guessing from the IIF function.
Based on the description of your issue being "an expression to show all selected values of a parameter in a Paginated Report" a DAX expression that would work is something like this
CONCATENATEX(
VALUES(Parameters[FieldName])
", "
)
Hope this helps...
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.