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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Calculate Average Metric month over month

Hello, 

 

I'm trying to create a visual to show the average month over month for each priority. 

 

If you look at this photo below this shows the data I'm working with: 

 

powerBI Question.JPG

 

For each month within the year I need to show the total for each priority and the percentage of met. Feb for example would show: 27 for the total and 81% for the met. I believe this could be done by creating new columns within the dataset and using IF statements to make them a 1 or 0 after which performing an add and divide. However, I believe there is an easier way. 

 

 

 

Thank you for your help! 

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

try measures

Total for priority = CALCULATE(SUM(Table[Count of Incident Number]), ALLEXCEPT(Table, Table[Year], Table[Month], Table[Priority]) )

and

%Met = 
DIVIDE(
CALCULATE(SUM(Table[Count of Incident Number]), ALLEXCEPT(Table, Table[Year], Table[Month], Table[Priority]), Table[Met MTTR] = TRUE() ),
[Total for priority]
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

5 REPLIES 5
az38
Community Champion
Community Champion

Hi @Anonymous 

try measures

Total for priority = CALCULATE(SUM(Table[Count of Incident Number]), ALLEXCEPT(Table, Table[Year], Table[Month], Table[Priority]) )

and

%Met = 
DIVIDE(
CALCULATE(SUM(Table[Count of Incident Number]), ALLEXCEPT(Table, Table[Year], Table[Month], Table[Priority]), Table[Met MTTR] = TRUE() ),
[Total for priority]
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hi @az38

 

This is very helpful! I did hit a little bit of a snag with this. It appears this requires a measure within a measure for me to get the count of incident number. I've created a measure to perform that; however, I'm getting the below error: 

 

Total for priority = CALCULATE(SUM([Count of Incident Number]), ALLEXCEPT(Sheet1, Sheet1[Year], Sheet1[Month], Sheet1[Priority]) )
The SUM function only accepts a column reference as the argument number 1. / Parameter is not the correct type
 
Have you experienced this before? I also tried to create only 1 line, but still have the same error of incorrect parameter: 
 
Total for priority = CALCULATE(SUM(COUNT(Sheet1[Incident Number]), ALLEXCEPT(Sheet1, Sheet1[Year], Sheet1[Month], Sheet1[Priority]) ))
 
Thank you!!
 
az38
Community Champion
Community Champion

Hi @Anonymous 

for using measure inside SUM() try SUMX() function like

Total for priority = CALCULATE(SUMX(Sheet1, [Count of Incident Number]), ALLEXCEPT(Sheet1, Sheet1[Year], Sheet1[Month], Sheet1[Priority]) )

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38

 

Thank you, that worked brilliantly! I was missing the sheet1 at the beginnning. 

az38
Community Champion
Community Champion

@Anonymous 

You tried to use SUM that does not need a table but can work only with Columns

SUMX(), COUNTX, AVERAGEX() are working with expressions. you can read here https://docs.microsoft.com/en-us/dax/sumx-function-dax


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.