Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
hanapbi
Helper I
Helper I

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..)

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

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


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

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


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors