Forum Discussion
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
| eno | ename | deptno | salary |
| 1 | Raja | 1 | 5000 |
| 2 | kirshore | 2 | 6000 |
| 3 | Naveen | 3 | 5500 |
| 4 | Santosh | 2 | 8000 |
| 5 | Praveen | 1 | 10000 |
I want output like below using calculatetable measure(required data having deptno=1).
| eno | ename | deptno | salary |
| 1 | Raja | 1 | 5000 |
| 5 | Praveen | 1 | 10000 |
the below measure is throwing error
Hi SivaReddy,
Create calculated table as:
CALCULATETABLE = CALCULATETABLE( 'Table','Table'[deptno]=1 )Here is the output:
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!
5 Replies
- lbendlin
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.
- ryan_mayu
Super User
why not just add a filter and set deptno =1?
- v-xulin-mstf
Community Support
Hi SivaReddy,
Create calculated table as:
CALCULATETABLE = CALCULATETABLE( 'Table','Table'[deptno]=1 )Here is the output:
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!