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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to average by category in measure with summarized table

Hi,

I have table 1 listed below in my dataset. What I want to do is to sum all the net requirements by Destination and File Month, and then take the average of net requirements by file month for each destination.  How would I do that in a measure? The 'material' column is irrelevant to the calculation. The intermediate calculation basically sums net requirements listed in table 1 by destination and file month. The desired result averages the intermediate calculation table by destination. Thank you!

zaminamina_0-1623123419143.png

 

Here's the sample data:

DestinationFile MonthMaterialNet Requirements
GermanyJan-21A45
GermanyJan-21B98
GermanyJan-21C65
GermanyFeb-21D78
GermanyFeb-21B84
GermanyFeb-21A53
USAJan-21A96
USAJan-21B52
USAJan-21C35
USAJan-21D5
USAJan-21E48
USAJan-21F32
USAJan-21G56
USAFeb-21A35
USAFeb-21C23
USAFeb-21F98
UKJan-21D45
UKJan-21E25
UKJan-21F95
UKFeb-21G78
UKFeb-21A15
UKFeb-21C25
UKFeb-21F35
UKFeb-21B95
UKFeb-21D87

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

you can try this

Measure = 
VAR tbl=SUMMARIZE('Table','Table'[Destination],'Table'[File Month],"net",sum('Table'[Net Requirements]))
return AVERAGEX(tbl,[net])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous 

you can try this

Measure = 
VAR tbl=SUMMARIZE('Table','Table'[Destination],'Table'[File Month],"net",sum('Table'[Net Requirements]))
return AVERAGEX(tbl,[net])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Wow, that works perfectly, thank you!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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