Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

GROUP BY Calculation

Hi, I have this Sprint data

 

1.png

 

 

 

 

 

 

 

And I want to calculate de "CALCULATION" column in Power BI

2.png

 

 

 

 

 

 

This is the SUM of Points for each Sprint DIVIDED BY COUNT of days for each Sprint 

 

Thanks in advance,

 

 

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You may use the following DAX to add a calculated column.

Column =
DIVIDE (
    SUMX ( RELATEDTABLE ( Table2 ), Table2[Points] ),
    COUNTROWS ( FILTER ( Table1, Table1[SPRINT] = EARLIER ( Table1[SPRINT] ) ) )
)

 

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

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You may use the following DAX to add a calculated column.

Column =
DIVIDE (
    SUMX ( RELATEDTABLE ( Table2 ), Table2[Points] ),
    COUNTROWS ( FILTER ( Table1, Table1[SPRINT] = EARLIER ( Table1[SPRINT] ) ) )
)

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@Anonymous Do you need this as a column? The other members equation does work if you use it as a measure. How are you

using this calculation further?

Group2.PNGGroup1.PNG

az38
Community Champion
Community Champion

Hi @Anonymous 

try a simple

= DIVIDE(SUM([Points]), COUNT([DAYS]))

but before be sure there is a relationship between your tables

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Wouldn't this just give the Total Points / Total Days? 700 / 12

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.