cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Average based on Groups

Hi, I am new to Power BI, and would like to achieve the following results for "Average by Customer" and Average by Customer Region" in the existing table.

 

This report is generated using Direct query mode using Tabular.

 

Calculation for "Average by Customer"
Measure1 = Sum by Product A
Measure2 = Sum by Product B
M% = Measure1/ Measure 2
Average by Customer = Average of M% by the count of distinct Products

 

Similarly , calculation for Average by Customer Region
Measure1 = Sum by Product A (Grouped by Customer Region)
Measure2 = Sum by Product B (Grouped by Customer Region)
M% = Measure1/ Measure 2
Average by Customer Region = Average of M% by the count of distinct Products

Capture.JPG

 

Excel calculation for Customer Region:

 

https://1drv.ms/x/s!ArLuftnPv6dwghbmVulAQkBdPywL?e=1cOGET

 

Capture.JPG

Average by Customer Region.JPG

 

 

 

 

 

 

 

 

Thanks in advance for your assistance.

 

1 ACCEPTED SOLUTION
Community Support
Community Support

Hi, @PPD 

Try to  create measure as below:

M% = [Measure 2] /[Measure 1]
Average by customer = AVERAGEX(SUMMARIZE('Table','Table'[Product],'Table'[Customer Region],"M%",[M%]),[M%])
Average by Customer Region = CALCULATE( [Average by customer],ALL('Table'))

38.png

 

Please check attached pbix for more details.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

8 REPLIES 8
Frequent Visitor

I leveraged the solution provided by @v-easonf-msft  with a few modifications. It worked. Thank you!

Community Support
Community Support

Hi, @PPD 

Try to  create measure as below:

M% = [Measure 2] /[Measure 1]
Average by customer = AVERAGEX(SUMMARIZE('Table','Table'[Product],'Table'[Customer Region],"M%",[M%]),[M%])
Average by Customer Region = CALCULATE( [Average by customer],ALL('Table'))

38.png

 

Please check attached pbix for more details.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

Hi @v-easonf-msft Eason, 

Thank you for your response, and sharing the PBIX file. Please see my response below. Capture.JPG

Frequent Visitor

@Ashish_Mathur .Attached the excel link. I couldnt attached the PBI file since this data model is created using direct query mode using Tabular.

https://1drv.ms/x/s!ArLuftnPv6dwghbmVulAQkBdPywL?e=1cOGET

Hi,

I believe your question has been answered.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Frequent Visitor

Hi @Ashish_Mathur . I updated the original post with the excel calculations.

Hi,

Share the download link of the Excel workbook.  Also, share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Super User III
Super User III

Hi,

Share the MS Excel file with your calculations.  I want to see how have you calculated figures in the "Customer by region" column


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors