Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Dear all,
I kindly need your expertise for creating a custom column that calcuates the average of several columns. The problem is I have a dataset that includes some "NA" values:
White | Black | Yellow | Red | Custom column (average of all colors) |
3 | 6 | 6 | 8 | Error |
1 | 9 | NA | 7 | Error |
If I included the "Yellow" column when calculating the average, the custom column gives an error because of the "NA" value.
What I am trying is to exclude the cells with "NA" values.
Excel is automatically excluding the "NA" values while calculating the average, but it seems that PowerBI does not.
Do you guys think of a workaround for this?
Thanks for your support in advance.
Ugur
Solved! Go to Solution.
Use something along the lines of:
Measure = AVERAGEX(FILTER('Table',[Yellow]<>"NA"),[Yellow])
Option 1: As pointed out use filter in your query
Option 2: Default value to 0 when blank or NA occurs that way your regular calculation would work.
Hi @Anonymous,
Based on my test, you could refer to Greg_Deckler's solution, also, you could refer to replace the 'NA' value in query editor:
Hope it could help you.
Regards,
Daniel He
Hi @Anonymous,
Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?
Regards,
Daniel He
Hi @Anonymous,
Based on my test, you could refer to Greg_Deckler's solution, also, you could refer to replace the 'NA' value in query editor:
Hope it could help you.
Regards,
Daniel He
Option 1: As pointed out use filter in your query
Option 2: Default value to 0 when blank or NA occurs that way your regular calculation would work.
Use something along the lines of:
Measure = AVERAGEX(FILTER('Table',[Yellow]<>"NA"),[Yellow])
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
78 | |
59 | |
36 | |
33 |
User | Count |
---|---|
98 | |
62 | |
56 | |
49 | |
41 |