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
Anonymous
Not applicable

List.Average ignores nulls, but now when doing a group by

Hello

 

When I add a column using the below code the resulting column value ignores nulls and I get the right value.

 

 =Table.AddColumn(#"Changed Type", "RowAverage", each List.Average({[Step_3.1],[Step_3.2],[Step_3.3]}))

 

When I use the group by function and choose the Average option, it doesn't appear to ignore nulls

 

=Table.Group(#"Filtered Rows", {"jira_issue_key_cd"}, {{"Step_3.1s", each List.Sum([Step_3.1]), type nullable number}, {"Step_3.2s", each List.Sum([Step_3.2]), type nullable number}, {"Step_3.3s", each List.Sum([Step_3.3]), type nullable number}, {"Step_3.2a", each List.Average([Step_3.2]), type nullable number}, {"Step_3.3a", each List.Average([Step_3.3]), type nullable number},  {"Count", each Table.RowCount(_), Int64.Type}})

 

 

The key column is text, Step_3.1, 3.2, 3.3 are all whole number types.

KeyStep_3.1Step_3.2Step_3.3
XXX--575211
XXX--575211
XXX--5751nullnull
XXX--5751nullnull
XXX--5751nullnull
XXX--575222
XXX--5752nullnull
XXX--5751nullnull
XXX--575211
XXX--575222
XXX--5751nullnull

 

KeyStep_3.1sStep_3.2sStep_3.3sStep_3.2aStep_3.3aCount
XXX--57517770.6363640.63636411

 

Thoughts?

 

Thanks

 

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

What's your previous step here:

Eyelyn9_2-1640593677360.png

 

On my side:

Eyelyn9_4-1640593761676.png

 

 

Best Regards,
Eyelyn Qin
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

7 REPLIES 7
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

If you still cannot solve the issue,sorry for that, we do not found an effective solution.
As you considered, you could go to https://powerbi.microsoft.com/en-us/support/ ,scroll down and click "CREATE SUPPORT TICKET" for further help if you are a pro user.

 

Best Regards,
Eyelyn Qin

v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

If so, could you please share me with your pbix file after removing sensitive data?

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

I don't know of a way to do that as the data all pulls from multiple SQL Sources and when you go into PBIX it would try to refresh against those sources. If there is an article that explains how to take a snapshot of a PBIX with the current dataset (disconnected and non-refreshing) I can easily do it.

 

Since the problem doesn't repeat if I copy and paste the data (as both you and Daniel did), I am wondering if I need to raise a ticket with MSFT and have a screen share.

 

v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

What's your previous step here:

Eyelyn9_2-1640593677360.png

 

On my side:

Eyelyn9_4-1640593761676.png

 

 

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

Anonymous
Not applicable

The filtered rows step brings it down to just the single ticket that is present in the example.

 

The problem I have is that your example (as well as Daniel's) works fine. If I copy the pre-average result into the clipboard, click "Enter Data" and paste it, I get the correct values. Using the 'source' data, I get the incorrect answer.

 

 

wdx223_Daniel
Super User
Super User

i got the correct result using the same code

wdx223_Daniel_0-1640334836137.png

 

Anonymous
Not applicable

I see that. I just replied to Eyelyn's response as well. It's fine if I copy and paste the data to a new query and do the average, just not when I am doing it against the source information.

 

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.

Top Solution Authors
Top Kudoed Authors