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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to get MEAN/AVERAGE of a WHOLE column that is a calculated Measure

I'm not sure how to approach this.

I need another measure to get the MEAN/AVERAGE of the WHOLE COLUMN based on a calculated measure (USA|HK).

USA|HK = IFERROR(DIVIDE(SUM('CONTROL_ROOM_TMC2'[BR_JAG]), SUM('CONTROL_ROOM_TMC2'[MX])),BLANK())

Average the whole column of  is = USA|HK 1.25
a.png

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the below picture and the sample pbix file's link down below.

Picture2.png

 

USA|HK Measure =
COALESCE ( AVERAGEX ( 'Table', DIVIDE ( 'Table'[USA], 'Table'[HK] ) ), "" )
 
result measure =
IF (
OR (
SELECTEDVALUE ( 'Table'[USA] ) = BLANK (),
SELECTEDVALUE ( 'Table'[HK] ) = BLANK ()
),
BLANK (),
CALCULATE ( [USA|HK Measure], ALL ( 'Table' ) )
)
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

Thank you for your feedback.

Please share your sample pbix file's link here, then I can try to look into it to find out the cause of the difference.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi Jihwan,
Thank you for the solution. Very helpful.

I ended up using this DAX based on your guidance.

MEAN =
IF (CALCULATE([BR_JAG|MX]) = BLANK (),
BLANK (),
AVERAGEX(
FILTER(
ALLSELECTED( CONTROL_ROOM_TMC2[PMD_PROGRAM_NAME] ),
CONTROL_ROOM_TMC2[PMD_PROGRAM_NAME] = ( CONTROL_ROOM_TMC2[PMD_PROGRAM_NAME] )
),
[BR_JAG|MX]
)
)



Anonymous
Not applicable

Hi Jihwan,

Thank you for helping out on this. I'm inputting your calculations but all my results are returning blank.b.pnga.png


Thank you for your feedback.

Please share your sample pbix file's link here, then I can try to look into it to find out the cause of the difference.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Dear Jihwan,

Thank you for your assistance. I tested by adding "SUM" to show up the numbers but the SUM is causing the incorrect avg. The 1st 4 columns are linked to SQL.

additional note: when i SELECTEDVALUE ( 'CONTROL_ROOM_TMC2'[BR_JAG]) = BLANK () it actually return as BLANK. So the column is saying it's blank. I just tested all columns of BR_JAG & MX and it's all blank.

COALESCE ( AVERAGEX (CONTROL_ROOM_TMC2, DIVIDE (SUM('CONTROL_ROOM_TMC2'[BR_JAG]), SUM('CONTROL_ROOM_TMC2'[MX])) ), "" )


Average =
IF (
OR (
SUM( CONTROL_ROOM_TMC2[BR_JAG] ) = BLANK(),
SUM( CONTROL_ROOM_TMC2[MX] ) = BLANK()
),
BLANK(),
CALCULATE ( [BR_JAG|MX], ALL ( CONTROL_ROOM_TMC2 ) )
)
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the below picture and the sample pbix file's link down below.

Picture2.png

 

USA|HK Measure =
COALESCE ( AVERAGEX ( 'Table', DIVIDE ( 'Table'[USA], 'Table'[HK] ) ), "" )
 
result measure =
IF (
OR (
SELECTEDVALUE ( 'Table'[USA] ) = BLANK (),
SELECTEDVALUE ( 'Table'[HK] ) = BLANK ()
),
BLANK (),
CALCULATE ( [USA|HK Measure], ALL ( 'Table' ) )
)
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi Jihwan,

Can I use the same structure to get Median?


MEDIANX(
SUMMARIZE(CONTROL_ROOM_TMC2,CONTROL_ROOM_TMC2[PMD_PROGRAM_NAME],"xxx",[BR_JAG|MX]),
[BR_JAG|MX])



Right now it doesn't give me the correct Median based on my [BR_JAG|MX]



Hi, @Anonymous 

Please try something like the below.

 

newmeasures =
MEDIANX (
SUMMARIZE (
CONTROL_ROOM_TMC2,
CONTROL_ROOM_TMC2[PMD_PROGRAM_NAME],
"xxx", [BR_JAG|MX]
),
[xxx]
)

 

thank you.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi Jihwan,

Did you see my link? 

Anonymous
Not applicable

Hi & Good Day Jihwan,

Please let me know if you can access this link.
https://drive.google.com/file/d/1321fxPGTEbQNzODsdxPRUowgbOJFQQ5T/view?usp=sharing

The main focus could be figuring out how to ignore blanks & zeros so that the median can return the correct number.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.