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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SivaReddy
Frequent Visitor

calculatetable measure is throwing error like multiple columns cannot be converted to scalar value

 I have created a table in sql server and loaded into powerbi. the table is like

 

enoenamedeptnosalary
1Raja15000
2kirshore26000
3Naveen35500
4Santosh28000
5Praveen110000

 

I want output like below using calculatetable measure(required data having deptno=1).

 

enoenamedeptnosalary
1Raja15000
5Praveen110000

 

the below measure is throwing error 

CalculateTable = CALCULATETABLE(Department_Groupfunction,Department_Groupfunction[deptno]=1)
 
error
The expression refers to multiple columns. Multiple columns can't be converted to a scalar value
 
could you please suggest how to fix this.
1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @SivaReddy,

 

Create calculated table as:

vxulinmstf_1-1627972823256.png

CALCULATETABLE = 
CALCULATETABLE(
    'Table','Table'[deptno]=1
)

Here is the output:

vxulinmstf_2-1627972846409.png

The pbix is attached.

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

View solution in original post

5 REPLIES 5
v-xulin-mstf
Community Support
Community Support

Hi @SivaReddy,

 

Create calculated table as:

vxulinmstf_1-1627972823256.png

CALCULATETABLE = 
CALCULATETABLE(
    'Table','Table'[deptno]=1
)

Here is the output:

vxulinmstf_2-1627972846409.png

The pbix is attached.

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

thanks

issue is fixed & Thanks

ryan_mayu
Super User
Super User

@SivaReddy 

why not just add a filter and set deptno =1?





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

Proud to be a Super User!




lbendlin
Super User
Super User

You cannot output a table as a measure. You can use CALCULATETABLE as part of your measure calculation steps but you must return a single (scalar) value at the end.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.