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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
ORLI
New Member

Calculated columns - calculation of averages

How to calculate the average x row for this table, using calculated column?

ABC
32 15
24168
1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@ORLI 

Column = 
VAR _numerator = 'Table'[A] + 'Table'[B] + 'Table'[C]
VAR _denominator = INT('Table'[A] <> 0) + INT('Table'[B] <> 0) + INT('Table'[C] <> 0)
RETURN
    DIVIDE(_numerator, _denominator)


Please don't forget to accept the message as a solution for community visibility.
P.S. Check out my showcase report - got some high level stuff there. Sure you will find there a lot of cool ideas. Please give it a thumbs up over there if you liked it 🙂
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543




View solution in original post

5 REPLIES 5
ORLI
New Member

Almost that, but note that in the calculation values 0 (zero) or empty cells must be disregarded

SpartaBI
Community Champion
Community Champion

@ORLI 

Column = 
VAR _numerator = 'Table'[A] + 'Table'[B] + 'Table'[C]
VAR _denominator = INT('Table'[A] <> 0) + INT('Table'[B] <> 0) + INT('Table'[C] <> 0)
RETURN
    DIVIDE(_numerator, _denominator)


Please don't forget to accept the message as a solution for community visibility.
P.S. Check out my showcase report - got some high level stuff there. Sure you will find there a lot of cool ideas. Please give it a thumbs up over there if you liked it 🙂
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543




SPARTABI THANK YOU SO MUCH!! YOU ARE AWESOME!!!

SpartaBI
Community Champion
Community Champion

@ORLI my pleasure 🙂 check out the report, trust me 🙂

SpartaBI
Community Champion
Community Champion

@ORLI do you mean like this or something else?

SpartaBI_2-1659444577428.png

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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