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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

How to calculate the sum of the averages in a category?

There are several cities.
There are zons in the cities.
Each section has a step, and for each step there is a goal.

I need to calculate the amount, but not just the amount.

Sum = (average for step 1) + (average for step 2) + (average for step 3) + (average for step 4) + (average for step 5)

Can this be done somehow with the help of a measure, or do you need to create a table where to count it?

 

CityZoneStepTarget
City111100
City11290
City11380
City11470
City11560
City12190
City12290
City12390
City12490
City12590
City13180
City13280
City13380
City13480
City13580
City211100
City212100
City213100
City21490
City21590
City22190
City22290
City22390
City22490
City22580
City23180
City23280
City23380
City23480
City23580

 

I need to display a graph.
Along the axis - cities, and columns above each other. Each bar should show the average step value. I can do this by putting the city on the axis and zone as a series, and then selecting the average function for the data. But I also need to calculate the goal and add a line, but for the goal the series does not work and either the sum of all goals (which does not fit) or the average of the series of ALL goals, which is not correct, is considered.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a measure like

sumx(summarize(Table, table[step], "_avg", average(Table[Target])),[_avg])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try a measure like

sumx(summarize(Table, table[step], "_avg", average(Table[Target])),[_avg])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Yes, looks good. Many thanks for you 😃

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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