D.R.
D.R.

Reputation: 65

summing up values in a column by type in DAX

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!

Upvotes: 0

Views: 137

Answers (1)

Himanshu Agrawal
Himanshu Agrawal

Reputation: 271

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

Upvotes: 1

Related Questions