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

Creating industry average

Hi!

I would like to calculate an industry average of total visits. How do i do that? 

I have to tables. 

Table 1: 

Customer name

Industry name

Customer 1Industry 1
Customer 2Industry 2
Customer 3Industry 1

 

Table 2

Customer nameDateVisits
Customer 115.06.2020102
Customer 215.06.20202034
Customer 315.06.2020540
Customer 116.06.2020203
Customer 216.06.20203042
Customer 316.06.2020654

 

So the result would be: 

Total visits of customer 1 = 305

Total visits of customer 2 = 5.076

Total visits of customer 3 = 1.194
Total visits of industry 1 = 1.499 

Total visits of industry 2 = 5.076

Industry 1 average = 749,5

Industry 2 average = 5.076 

 

The output i want to generate is: 

Industry nameIndustry average
Industry 1749,5
Industry 25.076 

 

I hope you can help me! 

1 ACCEPTED SOLUTION
FarhanAhmed
Community Champion
Community Champion

Try by creating 2 measures. Make sure that Industry and Visits table are joined properly

m_SUMVisits = SUM(Visits[Visits])
m_Avg = AVERAGEX(VALUES(Industry[Customer name]),[m_SUMVisits])

 







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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
FarhanAhmed
Community Champion
Community Champion

Try by creating 2 measures. Make sure that Industry and Visits table are joined properly

m_SUMVisits = SUM(Visits[Visits])
m_Avg = AVERAGEX(VALUES(Industry[Customer name]),[m_SUMVisits])

 







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

Proud to be a Super User!




Anonymous
Not applicable

Hi @FarhanAhmed 

 

Do you also happen to know how i can present the industry average next to each customers value? 

Like this: 

Customer nameTotal visits Industry average (m_avg)
Customer 13051.499 
Customer 25.0765.076
Customer 31.1941.499 

 

When i select the measure you helped me create "m_avg" it just shows the total visits in "Industry average" 

And if you also have the time I created industry averages for other values such as "Avg. order value industry average": "

Avg. order value industry average = AVERAGEX(VALUES(Customers[Customer name]),[Avg. order value])

But i would like to weigh the values by the percentage of visits that each customer have in the industry. So i get the following results below. 

Customer nameTotal visitsIndustry total visits% of industry total visitsAvg. order value
Customer 13051.49920,3520
Customer 25.0765.07610050
Customer 31.1941.49979,6530
 
IndustryAvg. order value industry           (Old calculation result) Avg. order value industry    (Wanted result)
Industry 1(20+30) / 2 = 2520*20,35%+30*79,65% = 27,965
Industry 25050
Anonymous
Not applicable

Hi @FarhanAhmed 

 

THANK YOU SO MUCH! I love this community! 😄 

It worked like a charm! 

For anyone in the future, my final two measures was named: 

Total visits = SUM('Sessions (SessionStats)'[Total sessions])
 
Visits average = AVERAGEX(VALUES(Customers[Customer name]),[Total visits])

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.