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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
SidharthK16
Frequent Visitor

Column and Row level average

Hi All,

Hope you are doing great!

I need some help in Dax Query.

where I need to calculate Row level and Column level average.

Sharing below the excel for the reference.

Row LabelsSpriteMazzaLimcaAverage
A14.0%25.3%15.9%18.4%
B10.1%9.6%9.0%9.6%
C8.0%10.2%6.7%8.3%
D 13.1%9.7%10.3%
E20.8%39.2%22.7%27.6%
Average13.2%19.5%12.8%15.3%

 

So, as shown below we have 5 Row level and 3 Brands in column.
What I need is to calculate Column and Row average(Highlighted in Bold).
Please give your expert advice.
Thanks 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@SidharthK16 , Assume you already have % measure, Try a measure like

 

Switch(True(),
not(isninscope(Table[Drink])) && isninscope(Table[Category]), AverageX(Values(Table[Drink]), [Measure]),
not(isninscope(Table[Category])) && isninscope(Table[Drink]), AverageX(Values(Table[Category]), [Measure]),
inot(isninscope(Table[Category])) && not(isninscope(Table[Drink])) , AverageX(Summarize(Table, Table[Drink],Table[Category]), [Measure]),
[Measure])

 

 

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@SidharthK16 , Assume you already have % measure, Try a measure like

 

Switch(True(),
not(isninscope(Table[Drink])) && isninscope(Table[Category]), AverageX(Values(Table[Drink]), [Measure]),
not(isninscope(Table[Category])) && isninscope(Table[Drink]), AverageX(Values(Table[Category]), [Measure]),
inot(isninscope(Table[Category])) && not(isninscope(Table[Drink])) , AverageX(Summarize(Table, Table[Drink],Table[Category]), [Measure]),
[Measure])

 

 

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

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

Thank you for help
I have to do some changes and its working

Thanks again

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.