Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ivancespedesl
Helper I
Helper I

Custom column count

Hi,

 

I was trying to create a custom column but once I wrote the simplest code ever:

 

= COUNT([Variable1]) + COUNT([Variable2])
 

It showed an error, since it does not recognize the count function. My goal is to count the cells where (is not null and >0) for a given User ID to know the amount of products he/she has with the company.

 

Any suggestion is more than welcome.

 

 

Thanks in advance,

 

IC

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi @ivancespedesl ,

 

you can use List.NonNullCount to get to count of items in the field that are not null.

 

= Table.Group(#"Replaced Value", 
     {"Company Name", "Policy Number", "Division", "Date"}, 
         {{"Count", each List.NonNullCount([Claim Amount]), type number}             
     })  

Or could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Please read this post to get your answer quickly: How to Get Your Question Answered Quickly.

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I tried this formula and it didnt work. Could you write it with my variables so I can get a sense of where should I locate each one?

 

Thanks,

 

IC

Hi,

 

I want to do this:

 

Cant_NECant_PR_VhCant_PR_TieCant_PR_HipCant_PR_ComCant_PR_PerCant_PR_LCCount Productos
1      1
1      1
1      1

 

Where Count Productos is =COUNTIF(Z2:AJ2, ">0"). I want to create this as a custom column in PBI or create a measure that does this and then calculates the AVG of Count Productos per Customer (imagine there is a different Customer ID per row)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.