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

Dax issue

Company ,    Product name
Tatamotors,        Tiago
Tatamotors ,       Alto
Tatamotors  ,     Nexo
Maruti ,              Ciaz
Maruti  ,            vagnour
Hundai  ,            I20
Hundai   ,          Creta

In above senario, Ihave to count total number of products by each company:

Below dax I have written but getting error as "The expression refrers to multiple column.Multiple columns can not be converted to a scalar value: Please suggest:

Groupby(Automobile,automobile[company],"Total number of Product", Countax(currentgroup(),automobile[product name]))

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

Hi Ashokkumarsah, 

 

GROUPBY() function return a table with the selected columns for the groupBy_columnName arguments and the grouped by columns designated by the name arguments. So you should create a new table, not a calculate column or measure.

 

Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi Ashokkumarsah, 

 

GROUPBY() function return a table with the selected columns for the groupBy_columnName arguments and the grouped by columns designated by the name arguments. So you should create a new table, not a calculate column or measure.

 

Regards,

Jimmy Tao

PattemManohar
Community Champion
Community Champion

@Anonymous Not sure why itsn't working ? Hope you are trying it as a "New Table"

 

Test130Out = GROUPBY(Test130GroupCnt,Test130GroupCnt[Company],"ProductCount",COUNTAX(CURRENTGROUP(),Test130GroupCnt[ProductName]))

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




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.