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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
souvik900766
Helper IV
Helper IV

Calculate Hierarchy of Averages within Category

Hi !
I want to find out the Average of the Averages !
When I select T10 from T10/NT10(My first slicer in dashboard), want to see the averages within T10.
Average of the Sub Categories will be the average of the respective products within T10,
Average of the  Categories will be the average of the respective Sub Categories within T10,
Average of T10 will be average of respective Categories within T10.
My Data:-

CategorySub CategoryProductT10/NT10Value
AA1P1T103
AA1P2T104
AA1P3T105
AA2P4T101
BB3P9T101
BB3P11T105
BB1P13T104
BB1P14T106
BB1P15T107
AA2P5NT104
AA2P6NT105
AA3P7NT103
AA3P8NT106
BB3P10NT104
BB3P12NT101

 

I have used a formula like this and My values for Category and Sub actegory is coming correct but not for T10/Nt10:-
Avg Value = AVERAGEX(SUMMARIZE(T1, T1[Category], T1[Sub Category],T1[T10/NT10), CALCULATE(AVERAGE(T1[Value])))
T10 will be average of Category A&B that falls within T10 and same for NT10

The desired answer I am looking for:-
Eg.PNG
Thanks in advance !

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mahoneypat
Microsoft Employee
Microsoft Employee

What are the #s you expect to see in the red highlighted cells?

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


amitchandak
Super User
Super User

@souvik900766 , Try if this measure can work

New measure =
var _tab = SUMMARIZE(T1, T1[Category], T1[Sub Category],"_1", CALCULATE(AVERAGE(T1[Value])))
return
AVERAGEx(summarize(_tab, _tab[Category], "_2", AVERAGEx(Table,_1)),_2)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi !
I am finding an issue in the return:- cant find _tab[Category] and _1,_2 is not coming.correction.PNG

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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