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.
So I have multiple columns in my table and I want to be able to add up each non blank column and give a final total of number of non blanks.
I've tried using (If(isblank(Column1),0,1)) + (If(isblank(Column2),0,1)) + (If(isblank(Column3),0,1)) but keep getting more ))) added on the ends and then error out.
Any ideas?
Cheers,
Solved! Go to Solution.
Hi @DarylRob ,
If you want to calculate the number of blank cells in all columns of the table, try the following measure.
Total null cells =
var Co1 = COUNTROWS( FILTER( 'Table', 'Table'[Column1] = BLANK() ) )
var Co2 = COUNTROWS( FILTER( 'Table', 'Table'[Column2] = BLANK() ) )
var Co3 = COUNTROWS( FILTER( 'Table', 'Table'[Column3] = BLANK() ) )
var Co4 = COUNTROWS( FILTER( 'Table', 'Table'[Column4] = BLANK() ) )
return Co1 + Co2 + Co3 + Co4
If you just want to count the columns where the entire column is empty, try the following measure.
Blank Columns =
var Co1 = IF( HASONEVALUE( 'Table'[Column1] ) && MAX( 'Table'[Column1] ) = BLANK(), 1, 0 )
var Co2 = IF( HASONEVALUE( 'Table'[Column2] ) && MAX( 'Table'[Column2] ) = BLANK(), 1, 0 )
var Co3 = IF( HASONEVALUE( 'Table'[Column3] ) && MAX( 'Table'[Column3] ) = BLANK(), 1, 0 )
var Co4 = IF( HASONEVALUE( 'Table'[Column4] ) && MAX( 'Table'[Column4] ) = BLANK(), 1, 0 )
return Co1 + Co2 + Co3 + Co4
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @DarylRob ,
If you want to calculate the number of blank cells in all columns of the table, try the following measure.
Total null cells =
var Co1 = COUNTROWS( FILTER( 'Table', 'Table'[Column1] = BLANK() ) )
var Co2 = COUNTROWS( FILTER( 'Table', 'Table'[Column2] = BLANK() ) )
var Co3 = COUNTROWS( FILTER( 'Table', 'Table'[Column3] = BLANK() ) )
var Co4 = COUNTROWS( FILTER( 'Table', 'Table'[Column4] = BLANK() ) )
return Co1 + Co2 + Co3 + Co4
If you just want to count the columns where the entire column is empty, try the following measure.
Blank Columns =
var Co1 = IF( HASONEVALUE( 'Table'[Column1] ) && MAX( 'Table'[Column1] ) = BLANK(), 1, 0 )
var Co2 = IF( HASONEVALUE( 'Table'[Column2] ) && MAX( 'Table'[Column2] ) = BLANK(), 1, 0 )
var Co3 = IF( HASONEVALUE( 'Table'[Column3] ) && MAX( 'Table'[Column3] ) = BLANK(), 1, 0 )
var Co4 = IF( HASONEVALUE( 'Table'[Column4] ) && MAX( 'Table'[Column4] ) = BLANK(), 1, 0 )
return Co1 + Co2 + Co3 + Co4
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |