Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Folks,
Im having a hard time transposing the table. Just need the Dax for the Output Table basis the Source table. Your response will be a big help.
Thanks in advance.
Solved! Go to Solution.
Hi @yaudje ,
This is better done on Power Query using the Unpivot option however in dax you can use the following code:
Table 2 = UNION(
SELECTCOLUMNS('Table', "Sales", 'Table'[Sales],"Area", 'Table'[Area], "Year", 2019, "value", 'Table'[2019]),
SELECTCOLUMNS('Table',"Sales", 'Table'[Sales],"Area", 'Table'[Area], "Year", 2020, "value", 'Table'[2020]),
SELECTCOLUMNS('Table',"Sales", 'Table'[Sales],"Area", 'Table'[Area], "Year", 2021, "value", 'Table'[2021]))
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @yaudje ,
This is better done on Power Query using the Unpivot option however in dax you can use the following code:
Table 2 = UNION(
SELECTCOLUMNS('Table', "Sales", 'Table'[Sales],"Area", 'Table'[Area], "Year", 2019, "value", 'Table'[2019]),
SELECTCOLUMNS('Table',"Sales", 'Table'[Sales],"Area", 'Table'[Area], "Year", 2020, "value", 'Table'[2020]),
SELECTCOLUMNS('Table',"Sales", 'Table'[Sales],"Area", 'Table'[Area], "Year", 2021, "value", 'Table'[2021]))
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsSUper thanks. This one works:-) Cheers mate/
Don't forget to accept the correct answer so it can help others
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThe Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 143 | |
| 125 | |
| 100 | |
| 80 | |
| 55 |