If you want an easy setup this transformation could be done with excel using pivot table, you can either export your table from power bi visual or save your table as an excel file. after performing pivot table you can re import it again in your power BI data model