Forum Discussion

NickTeam17's avatar
NickTeam17
Frequent Visitor
6 years ago
Solved

Calculating differences between multiple columns and then the median of these values

Hi I have been asked to calculate the following three stage exercise: Calculate the differences between the weekly data in the table below  Calculate the median of those weekly differences for a ...
  • AllisonKennedy's avatar
    6 years ago
    NickTeam17

    I suggest you unpivot this data, which is done in the Power Query Editor.

    So to make it as dynamic as possible select all the columns that are NOT weeks, then select Unpivot Other Columns..

    Then you will have two columns: Attribute and Value. Rename Attribute to Week Number and Value to whatever you want.

    When you've got that under control, come back and see us if you need more help with calculating the average, difference and filtering by week, but this will be more straightforward once it's in columns.

    https://radacad.com/pivot-and-unpivot-with-power-bi