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
Biccbacc
Frequent Visitor

Inter-office Strava "light" system: Devide sum by external factor

Hi!

 

I need help with a stacked colum chart. 

 

I am running a contest at work where you register all your activites to and from work. cycling, running, walking etc. 

My data comes from a power BI dataset, constantly updated from a sharepoint list. The sharepoint list consists of thousands of elements. Each element has data on: Name, office branch, department, activity, distance 

 

Visualizing this in power bi is a lot of fun, but there is one chart I cant get to work:

I want to show sum of distance, devided by employees in branch. 

As it is now, I can only show sum of distance PER branch. Some branches has hundreds of emplyees, while others only have a few. The current chart is pretty useless, as its really just a chart of office-size. 

Not all employes in every branch is participating, but I have the correct numbers of employees in each branch, its just not included in the dataset. 

How can i devide the sum from each branch by the number of employees in each branch, and show that average in a chart?

chart.PNG

1 ACCEPTED SOLUTION
TeigeGao
Solution Sage
Solution Sage

Hi @Biccbacc ,

According to your description, my understanding is that you want to calculate the divide of total distance with the count of employee for each branch.

In this scenario, we can create a relationship between the employee table and activity table, then create a measure like below:

Measure = DIVIDE(SUM(activite[activite]),COUNT(employee[employee]))

The result will like below:

PBIDesktop_vGAQ9Qo3SL.png

Best Regards,

Teige

View solution in original post

1 REPLY 1
TeigeGao
Solution Sage
Solution Sage

Hi @Biccbacc ,

According to your description, my understanding is that you want to calculate the divide of total distance with the count of employee for each branch.

In this scenario, we can create a relationship between the employee table and activity table, then create a measure like below:

Measure = DIVIDE(SUM(activite[activite]),COUNT(employee[employee]))

The result will like below:

PBIDesktop_vGAQ9Qo3SL.png

Best Regards,

Teige

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.