Forum Discussion

harmonvi's avatar
harmonvi
Regular Visitor
5 years ago
Solved

Divide column values every week

I need to divide weekly productivity per employee, by weekly hours per employee, repeating every week for the year. I need to keep every week's data so that I can track historical data.   Is there ...
  • v-alq-msft's avatar
    5 years ago

    Hi, harmonvi 

     

    Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

    Productivity:

     

    Hours:

     

    Then you need to make the week columns selected and unpivot them in Power Query.

     

    Then you may create a measure as below.

    Result = 
    DIVIDE(
        DIVIDE(
            SUM(Hours[Value]),
            CALCULATE(
                SUM(Productivity[Value]),
                FILTER(
                    ALL(Productivity),
                    [Name] in DISTINCT(Hours[Name])&&
                    [Week] in DISTINCT(Hours[Week])
                )
            ),0
        ),8
    )

     

    Result:

     

    Best Regards

    Allan

     

    If this post helps,then consider Accepting it as the solution to help other members find it faster.