Forum Discussion
Anonymous
7 years agoNot applicable
Group and Sum Row by Row
Hello, Please see below, I want to group “KEY” column once I group same key ,In a new column I want to display total quantity and total sales price. I have used Group by and I am getting below err...
- Anonymous7 years ago
give this a try:
Table = ADDCOLUMNS( SUMMARIZECOLUMNS(Table1[Key]), "Total Qty", CALCULATE( SUM( Table1[Quantity])), "Total Sales Price", CALCULATE( SUM( Table1[Sales Price])) )
Anonymous
7 years agoNot applicable
give this a try:
Table =
ADDCOLUMNS(
SUMMARIZECOLUMNS(Table1[Key]),
"Total Qty", CALCULATE( SUM( Table1[Quantity])),
"Total Sales Price", CALCULATE( SUM( Table1[Sales Price]))
)Anonymous
7 years agoNot applicable
Hi Nick,
Thank you so much for your suggestion.
When i tried your suggestions i am getting below error,
"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.".
Thanks
Anonymous wrote:give this a try:
Table = ADDCOLUMNS( SUMMARIZECOLUMNS(Table1[Key]), "Total Qty", CALCULATE( SUM( Table1[Quantity])), "Total Sales Price", CALCULATE( SUM( Table1[Sales Price])) )
- Cmcmahan7 years ago
Resident Rockstar
Are you creating this as a new table, or as a new measure? This should be a new table
- Anonymous7 years agoNot applicable
Hi,
i do not want new table i want two new columns.
Thanks
Cmcmahan wrote:Are you creating this as a new table, or as a new measure? This should be a new table
- Anonymous7 years agoNot applicable
Hi
Cmcmahan suggestion is correct. You need to have a new table, not additional columns. The expected result you showed us is a summarized table, with a different grain (one row per each key).