Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Group by based on DAX column

I have 2 tables in the model. In the firsttable I bring a column from the second table using DAX function RELATED.

Talble 1:

Order IDProduct ID
16281
92002
86153
38744
10571
72502
12433
46684

 

Table 2:

Product IDPrice
1100
250
3150
4230

 

And the first table after bringing another column:

Order IDProduct ID

Price

16281100
1628250
86153150
38744230
10571100
7250250
38743150
46684230

 

Now I need a new table that will show me Order ID and the total amount:

Order IDTotal Amount
1057100
1628150
3874380
4668230
725050
8615150

 

I tried to do it in a few ways and non recognizes the new price column. 

I tried to add a table in the following way:

Total Price per order = SUMMARIZECOLUMNS(Orders[Order ID], "Total Order Price", Orders[Price])
 
I get the following error: 
A single value for column rpice in table Prders cannot be determined..
 
What am I doing wrong?

(couldn't find a way to attach the file..)

  • Anonymous Try: Total Price per order = SUMMARIZECOLUMNS(Orders[Order ID]"Total Order Price", SUM(Orders[Price]))

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous Try: Total Price per order = SUMMARIZECOLUMNS(Orders[Order ID]"Total Order Price", SUM(Orders[Price]))