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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Marit
Helper II
Helper II

Calculate average within category

Hi!

 

Earlier I asked about how I could calculate an average above several categories in a line plot. I used the DAX syntax:

New measure=CALCULATE(AVERAGE('Table'[Value]), ALL('Table'[Category1]),

ALL('Table'[Category2]), ALL('Table'[Category3]))

 

This worked really fine. However, now I want to calculate an average within category1 and above all other categories. Thus, I want an average for each level in category1. Is this possible?

 

Regards Marit

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Marit ,

 

You just need to calculate the average for each category:

 

 

AVERAGE 1= CALCULATE(AVERAGE('Table'[Value]); ALLSELECTED(Table[Category1])

 

Just repeat this for each of the category.

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Marit ,

 

You just need to calculate the average for each category:

 

 

AVERAGE 1= CALCULATE(AVERAGE('Table'[Value]); ALLSELECTED(Table[Category1])

 

Just repeat this for each of the category.

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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