Forum Discussion
DAX Code to sum columns
- 1 year ago
Hi squizzonk,
I Started by clicking "Enter Data" and created a simple table with columns: Name, Product A, and Product B. After loading the table, navigate to Power Query Editor by selecting "Transform Data" from the Home ribbon. In the editor, select both "Product A" and "Product B" columns while holding Ctrl, then right-click and choose "Unpivot Columns". Rename the resulting "Attribute" column to "Product" and the "Value" column to "Amount". Click "Close & Apply" to return to Power BI. In the report view, insert a Table visual and drag the Product and Amount fields into the visual. Power BI will automatically summarize the Amount by each Product.
I have included the PBIX file that I created using the provided sample data. Kindly review it and confirm whether it aligns with your expectations.
Thank you and comtinue using Microsoft Fabric Community Forum.
Hi squizzonk,
I Started by clicking "Enter Data" and created a simple table with columns: Name, Product A, and Product B. After loading the table, navigate to Power Query Editor by selecting "Transform Data" from the Home ribbon. In the editor, select both "Product A" and "Product B" columns while holding Ctrl, then right-click and choose "Unpivot Columns". Rename the resulting "Attribute" column to "Product" and the "Value" column to "Amount". Click "Close & Apply" to return to Power BI. In the report view, insert a Table visual and drag the Product and Amount fields into the visual. Power BI will automatically summarize the Amount by each Product.
I have included the PBIX file that I created using the provided sample data. Kindly review it and confirm whether it aligns with your expectations.
Thank you and comtinue using Microsoft Fabric Community Forum.
- squizzonk1 year agoRegular Visitor
Thanks much!!