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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jcarbo0321
New Member

Count the number of values in a row across columns

Hello -

 

I have a table like the one here: Snip for Forum Help - 09OCT2023.png

And I would like to create a measure or a calculated column or anything that would return the average of a row across columns, ignoring the blanks. Ideally, this would mean that a row with blanks would be calculated as an average of the true numbers across the row. For example, in the table in Excel where the above information can be found, I made a column with formula: 

=AVERAGE([Jan FTE]:[Dec FTE]) which always calculates correctly, but I would rather it be a DAX measure or column if at all possible. Mainly because Power Pivot is determining the type of these columns as text and I can't get it to change despite many tries. 

Is there an easy way to do this in DAX? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jcarbo0321 ,

 

Power bi DAX calculations are for columns, if you want to achieve this idea, I suggest you first transform the data.

Based on your description, I create a simple sample:

vtianyichmsft_4-1696991999511.png

 

The first step is to create an index for the table in order to pivot the columns:

vtianyichmsft_5-1696991999513.png

 

Then pivot column:

vtianyichmsft_8-1696992271165.png

 

This can be accomplished using the index field and measure and below is the result:

Measure = AVERAGE('Table'[Value])

vtianyichmsft_9-1696992338418.png

 

Perhaps this will work, and if you have any questions, please provide me with more information to make sure we can better solve the problem for you!

 

An attachment for your reference. Hope it helps.

 

Best regards,


Community Support Team_ Scott Chang

 

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @jcarbo0321 ,

 

Power bi DAX calculations are for columns, if you want to achieve this idea, I suggest you first transform the data.

Based on your description, I create a simple sample:

vtianyichmsft_4-1696991999511.png

 

The first step is to create an index for the table in order to pivot the columns:

vtianyichmsft_5-1696991999513.png

 

Then pivot column:

vtianyichmsft_8-1696992271165.png

 

This can be accomplished using the index field and measure and below is the result:

Measure = AVERAGE('Table'[Value])

vtianyichmsft_9-1696992338418.png

 

Perhaps this will work, and if you have any questions, please provide me with more information to make sure we can better solve the problem for you!

 

An attachment for your reference. Hope it helps.

 

Best regards,


Community Support Team_ Scott Chang

 

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

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors