0
votes

I have a table

Table1

I want to sum up the values for each type and create two other measures/columns (percentage and cumulative percentage) as shown in the table below Table2

I tried with the following DAX

column = summarize(Table1, Table1[Type], "Total Value", sum(Table1[value]))

but I get the following error. I also tried with the GroupBy function, I get the same error. The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

Please help!

1
Does it have to be done in DAX or can you do it in the DB layer considering it is a database source? - A Modgil
The summarize function return a table. Error you are getting as you are trying to add the output of in a column. If you wants to play with results return from summarize, just use a Custom table to hole the output. - mkRabbani

1 Answers

1
votes

Original data and Final output enter image description here

Details of target data:
For Value column Select aggregation as sum

enter image description here

For %GT Value column (percentage column in you case). Pull the value column once again in table visual and select "Show value as" then select "Percent of grand total" enter image description here

For Cumulative percentage, create a quick measure for running total and display it again as "Percent of grand total"

enter image description here