DAX, Power BI, summarize table based on two columns

Viewed 2205

Let's say that table looks like this :

id step time
1 a 0.5
1 a 0.7
1 b 1
1 b 1.5
2 a 0.9
2 a 0.8

It's super simplified, but as you can see we can have the same ID and step more than once.

The question is how to create a measure in PowerBI ( DAX) to summarize time under two or more conditions without listing all steps and IDs (for example for ID "1" step "a" occurs twice so my sum should be 1.2, step "b" 2.5 etc.)

1 Answers

There is a nice function SUMMARIZE. You can create a table using this function:

Table 2 = SUMMARIZE(ALL('Table'), [id], [step], "time", SUM('Table'[time]))

enter image description here

Related