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
Jolyon
Helper III
Helper III

Calculate sum of averages by month and item?

Hello,

 

I have a table with forecast revenue for three Items and three Months.
The problem is, that there can be several forecast records for each Month (for Example: Item 1 has 4 forecasts for July),as in source table below.

 

Now I need to calculate the sum of average revenue of all Items by Months (the revenue should be taken as average for each Month and Item).

 

And below is just sample table to understand, what data I need in the result  and the line diagramm.Source table.pngTable for understanding.pngTable 2.png

 

How can I first calculate the average value by Month and Item?

and then calculate the sum of averages?

 

It it possible to do it in one formula?

 

I tried a lot of things with the little DAX i know but nothing worked out correctly. 

thank you in advance!

 

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@Jolyon It's actually very easy to do. After importing data go to power bi desktop query editor and under Transform tab Group By as below.

 

Capture.PNG

View solution in original post

2 REPLIES 2
AlexChen
Employee
Employee

Hi,

 

You can create a table using one formula to calculate average  value by month and item:

 

avg foreast = SUMMARIZE(

                foreast,

                foreast[product],

                foreast[month],

                "Average foreast revenue(by month)", AVERAGEX(foreast, foreast[foreast Revenue])

                )

 

1.png

 

Best Regards

Alex

 

ankitpatira
Community Champion
Community Champion

@Jolyon It's actually very easy to do. After importing data go to power bi desktop query editor and under Transform tab Group By as below.

 

Capture.PNG

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.