The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello, I'm trying to create a new measure that will take value 1 if number of rows in a specific table is greater than 10, and 0 otherwise. Here's the code that I use:
GreaterThanTen = IF(COUNTROWS(Table)>10,1,0)
This measure always returns 0, although there are cases when it's supposed to be 1.
Can you please explain what's wrong?
Thank you.
I have replicated your scenario.
GreaterThanTen = IF(COUNTROWS('Table')>10,1,0)
It is working for me
When I apply the filter it is returning zero, which is expected.
In your case, maybe some external filters are there. Verify that.
If you don't want to affect external filters, you can use ALL() or ALLEXCEPT() functions.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |