cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Divide sum of one column by sum of another column then filter by month

Hi, absolute beginner here. With reference to the data below, I want to create a bar chart which displays the values of total weight/ total hours by month. Month is filtered by end date. So for instance total weight/ total hours for June is (100 + 75) / (0.75 + 1) = 100,

and (150+40 +200) / (1.5 +1+4) = 60.

 

Any help is much appreciated!

 

Start DateEnd DateHoursWeight
1/6/2019 0:151/6/2019 1:000.75100
4/6/2019 8:004/6/2019 9:00175
30/6/2019 23:301/7/2019 1:001.5150
1/7/2019 6:001/7/2019 7:00140
6/7/2019 0:156/7/2019 4:154200

 

meta-chart.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Divide sum of one column by sum of another column then filter by month

Hi @Anonymous 

 

Please add the calculated column [MonthofEnddate] then use the measure:

ME = MONTH(Table1[End Date])

Measure = var a = CALCULATE(SUM(Table1[Weight]),ALL(Table1),VALUES(Table1[ME]))
var b = CALCULATE(SUM(Table1[Hours]),ALL(Table1),VALUES(Table1[ME]))
Return
DIVIDE(a,b)

6.png

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: Divide sum of one column by sum of another column then filter by month

Hi @Anonymous 

 

Please add the calculated column [MonthofEnddate] then use the measure:

ME = MONTH(Table1[End Date])

Measure = var a = CALCULATE(SUM(Table1[Weight]),ALL(Table1),VALUES(Table1[ME]))
var b = CALCULATE(SUM(Table1[Hours]),ALL(Table1),VALUES(Table1[ME]))
Return
DIVIDE(a,b)

6.png

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

Re: Divide sum of one column by sum of another column then filter by month

Hi @Anonymous ,

 

If my above post helps, could you please consider Accept it as the solution to help the other members find it more quickly. thanks!

Best regards,
Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 268 members 3,070 guests
Please welcome our newest community members: