Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello
I have this simple column for which I am trying to calcualte a MEDIAN value as below.
But it gives an error saying -- "Expressions that yield variant data-type cannot be used to defined calculated columns"
Any inputs on this?
Solved! Go to Solution.
hmm, for even number of items median can be decimal number even if it's based on Whole numbers.
can you try switching data type to Decimal with format as Whole?
I'm not 100% sure, but I think that you need to change the data type of Column1 from Any to Number
are you sure it's the data type and not format? they're just next to each other in the UI
unless you changed it in the query editor, then it must be something else - are there any non numeric values in that column?
Yup, both are "Whole Number". See below -
There are no non-numeric values in this column. My earlier screenshot shows all the values available for this column.
hmm, for even number of items median can be decimal number even if it's based on Whole numbers.
can you try switching data type to Decimal with format as Whole?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 21 | |
| 18 |