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! Request now

Reply
Anonymous
Not applicable

Sum a measure within a table

Hello,

 

I am working on creating an interactive report to show which of our cost centers spent more per device than the average on a monthly basis. I am using a measure called the Average Annual Total Cost which is always changing due to input from the user. I want to create a table visual that will show how many months in the last 12 that a cost center has a total cost above the Average Annual Total Cost. I created an indictor using another measure that is either 1 if the cost center's total cost is greater than the annual average and 0 otherwise. However, when I try to sum the indicator measure I find out that I not able to sum a value that is not in a column. Can anyone help me solve this dilema?

 

What I have:

Cost CenterPO MonthPO Year Total Cost Indicator
(measure not present in data)
1234102019 $         3,0701
1234112019 $         7,1751
456712020 $         1,6090
456722020 $         4,9241
8910102019 $         1,7290
8910112019 $         1,5140
1112112019 $         3,0711
1112102019 $         8,4260
1112122019 $         3,0341

 

Table I want to build in a visual:

Cost CenterNumber of times above average
(sum of indicator)
12342
45671
89100
11122

 

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

hi  @Anonymous 

This is a measure totals problem. Very common. See this post about it
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

For your case, just create a new measure as below:

Measure = 
var _table=SUMMARIZE('Table','Table'[Cost Center],'Table'[PO Year],'Table'[PO Month],"_value",[Indicator]) return
SUMX(_table,[_value])

 

Regards,

Lin

 

Community Support Team _ Lin
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

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

This is a measure totals problem. Very common. See this post about it
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

For your case, just create a new measure as below:

Measure = 
var _table=SUMMARIZE('Table','Table'[Cost Center],'Table'[PO Year],'Table'[PO Month],"_value",[Indicator]) return
SUMX(_table,[_value])

 

Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous ,

Try like

sumx(summarize(table,table[Cost Center],table[PO Month],,table[PO Year],"_sum",[Indicator]),[_sum])

 

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
Greg_Deckler
Community Champion
Community Champion

This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

 

So probably something like:

Measure = 
  SUMX(
    ADDCOLUMNS(
      'Table',
      "__Indicator",[Indicator]
    ),
    __Indicator
)

 

Put that measure in you visual along with Cost Center. 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors