Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

GROUP BY Calculation

Hi, I have this Sprint data

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

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

 

Thanks in advance,

 

 

 

  • 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] ) ) )
    )
    

     

4 Replies

  • az38's avatar
    az38
    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

    • Anonymous's avatar
      Anonymous
      Not applicable

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

  • Anonymous's avatar
    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?

  • v-chuncz-msft's avatar
    v-chuncz-msft
    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] ) ) )
    )