cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors