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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
KristinaSp
Helper I
Helper I

Simple average from measure averages by category

Hi,

 

I have the task, that is very simple in excel, but I cant figure out it in Powerbi desktop.

This is the data sample:

I need to calculate average profitability liek in the example.

 

PlaceIncome          Net profit                 Net profitability
A1000101,00%
B2000201,00%
C1500040,03%
Total18000340,19%
    
I need: (1+1+0,03)/3 =0,68%

 

My measure DIVIDE (SUM(net profit), SUM(income)) gives me 0.19%, while I need to get 0.68%.

 

Please help me with this task.

 

Best wishes,

Kristina

 

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

Hi @KristinaSp ,

 

You can create a new measure

new Net profitability = var _total=SUMX('Table',[Net profitability])
return IF(ISINSCOPE('Table'[Place]),[Net profitability],DIVIDE(_total,COUNT('Table'[Place])))

8.png

 

 

 

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Write these measures:

Total income = SUM(Data[Income          ])
Total profit = SUM(Data[Net profit                 ])
Net profitability (%) = DIVIDE([Total profit],[Total income])
Measure = if(hasonevalue(Data[Place]),[Net profitability (%)],AVERAGEX(VALUES(Data[Place]),[Net profitability (%)]))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-stephen-msft
Community Support
Community Support

Hi @KristinaSp ,

 

You can create a new measure

new Net profitability = var _total=SUMX('Table',[Net profitability])
return IF(ISINSCOPE('Table'[Place]),[Net profitability],DIVIDE(_total,COUNT('Table'[Place])))

8.png

 

 

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.