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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

new measure group by from two tables

Hello guys,

This is my first project with PowerBI. here is my problem, I have two related tables as you can see below. 

I want to make new measure to get total sales(ordval) from orders table per weekdays (wkd) from the datum table. 

This is the formula 

new measure = GROUPBY (orders,datum[wkd],"sales by wkd",SUMX(CURRENTGROUP(),orders[ordval]))
 and this is the error
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

Capture.PNG

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

For your formula, GROUPBY (<table>, [<groupBy_columnName1>], [<name>, <expression>]… )

Group by returns a table with the selected columns for the groupBy_columnName arguments and the grouped by columns designated by the name arguments.

So it is used to create a new table, not a new measure.

1.JPG

https://docs.microsoft.com/en-us/dax/groupby-function-dax

For a measrue, you could just use this simple formula,

Measrue = CALCULATE(SUM(orders[ordval]))

Then drag datum[wkd] and this measure into a visual.

 

Best Regards,
Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

For your formula, GROUPBY (<table>, [<groupBy_columnName1>], [<name>, <expression>]… )

Group by returns a table with the selected columns for the groupBy_columnName arguments and the grouped by columns designated by the name arguments.

So it is used to create a new table, not a new measure.

1.JPG

https://docs.microsoft.com/en-us/dax/groupby-function-dax

For a measrue, you could just use this simple formula,

Measrue = CALCULATE(SUM(orders[ordval]))

Then drag datum[wkd] and this measure into a visual.

 

Best Regards,
Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you guys


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.