cancel
Showing results 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.

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.

 Place Income Net profit Net profitability A 1000 10 1,00% B 2000 20 1,00% C 15000 4 0,03% Total 18000 34 0,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%.

Best wishes,

Kristina

1 ACCEPTED SOLUTION
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])))``````

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.

2 REPLIES 2
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.

Regards,
Ashish Mathur
http://www.ashishmathur.com
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])))``````

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.

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors