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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
soumit
New Member

dax not working on report view

Dear experts i need help, i dont understand why i cant use topn,filter,summarize function in dax , here is an example 

CALCULATETABLE(TOPN(10,Car_sales,Car_sales[Horsepower],DESC)),its a very simple formula aims to give top values based on horsepower column of the Car_sales table the problem that im facing is its working in the Dax query view but not in the report view , its showing me this message " The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value. " why itsonlyScreenshot 2024-06-03 020911.pngScreenshot 2024-06-03 020945.png working on the query view 
another example Top10Cars =
TOPN (10,SUMMARIZE ('Car_sales','Car_sales'[Manufacturer], 'Car_sales'[Model],"TotalSales", SUM ( 'Car_sales'[Sales_in_thousands] )),[TotalSales], DESC) this one aims to get the top 10 car manufatures and the model based on the sales again i can see the result in the query view but its showing this " The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value. "
1 ACCEPTED SOLUTION
sjoerdvn
Super User
Super User

Your DAX query returns a table, so you cannot use it as a measure, since a measure should return a scalar value.
You could use it as a (calculated) table, but note that the query would be exdcuted when (loading) processing the model; so it will not take into account any slicers or filters.

 

Instead, you could also add a TOP N filter to a visual

sjoerdvn_0-1717431937440.png

 

View solution in original post

1 REPLY 1
sjoerdvn
Super User
Super User

Your DAX query returns a table, so you cannot use it as a measure, since a measure should return a scalar value.
You could use it as a (calculated) table, but note that the query would be exdcuted when (loading) processing the model; so it will not take into account any slicers or filters.

 

Instead, you could also add a TOP N filter to a visual

sjoerdvn_0-1717431937440.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.