Forum Discussion
sum multiple columns
I have three columns with the sames machine in some of the other columns and i have a column showing the sqm how can i show the value for each machine in one one column, for example combine all of the sqm for the Master cut across all three columns to allow me to put a slicer on the dashvoard to choose one machine and give the total sqm for that machine.
Hi Julier
- Unpivot Columns: Go to Power Query, select the three machine columns, right-click, and Unpivot Columns, or alternatively select the SQM and Unpivot other Columns.
- Rename the new value column to Machine Description.
- Group By: Use Group By on Machine Description to sum SQM.
- Analyze the data: For instance, create a slicer and use the Machine Description to filter the data by machine and show total SQM.
Pedro Reis - Data Platform MVP / MCT
Making Power BI and Fabric Simple
If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!
Find me at LinkedInWorked like a dream thank you!
4 Replies
- uzuntasgokberkSuper User
Hello Julier ,
You can use slicer each text columns and then select the value in the slicers with using hiearchy from 3 columns. İf you don't want to use slicer and give the values only you specify that you need to write measure.
For example you want to calculate only for master cut.
measuretest=
CALCULATE(SUM(table[SQM]),FILTER(table, table[secondmachinedesc] = "Master Cut"))But if you'd like toRemoves context filters from columns and rows in the current query, while retaining all other context filters or explicit filters. you can use in the measre ALLSELECTED too.
Kind Regards,
Gökberk Uzuntaş
📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!
🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok | - pmreisMost Valuable Professional
Hi Julier
- Unpivot Columns: Go to Power Query, select the three machine columns, right-click, and Unpivot Columns, or alternatively select the SQM and Unpivot other Columns.
- Rename the new value column to Machine Description.
- Group By: Use Group By on Machine Description to sum SQM.
- Analyze the data: For instance, create a slicer and use the Machine Description to filter the data by machine and show total SQM.
Pedro Reis - Data Platform MVP / MCT
Making Power BI and Fabric Simple
If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!
Find me at LinkedIn- JulierHelper III
Worked like a dream thank you!
- AnonymousNot applicable
Hi Julier ,
If you don't want to change the schema of the table, try creating a table for the slicer like this:
Relationship:
And then please create a new measure:
Total SQM = VAR __selected_value = SELECTEDVALUE('DimConversionMachine'[ConversionMachine]) VAR __result = SUMX( FILTER( ALL('Table'), 'Table'[First Conversion Machine Description]=__selected_value || 'Table'[Second Conversion Machine Description]=__selected_value || 'Table'[Third Conversion Machine Description]=__selected_value ), 'Table'[SQM] ) RETURN __resultBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum