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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anders_G
Helper I
Helper I

Create Custom column based on count of values in other columns

Hi,

 

I want to create a custom column (column 7) that does a count of non-null values in columns 1 to 6.

 

Need it as a Power Query.

 

Anders_G_0-1666857977406.png

 

Thank you!

1 ACCEPTED SOLUTION

I think you can use a similar principle. Add a custom column as

List.NonNullCount( { [Column 1], [Column 2], [Column 3] } )

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

I think you could create a new column like

Column 7 =
VAR TmpTable = { 'Table'[Column 1], 'Table'[Column 2], 'Table'[Column 3] }
RETURN
    COUNTAX ( TmpTable, [Value] )

Thank you, that solution works for adding a column in the regular table view. But I just realised I need it as a Power Query. 

I think you can use a similar principle. Add a custom column as

List.NonNullCount( { [Column 1], [Column 2], [Column 3] } )

Brilliant. Thank you very much! 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.