cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jagostinhoCT
Post Partisan
Post Partisan

Expressions that yield variant data-type cannot be used to define calculated columns.

Getting this error while trying to create a calculated column with values from another column that are all formatted as Whole Numbers.

 

Quartile Rank = CALCULATE(PERCENTILE.INC(ProjectAuditsDB[Warnings / 1000 Elements],1))

 

Can you please explain why am I getting this error if the data-type is not variant?

 

Thank you

J

 

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

I'm not sure what exactly is going on, but as I change the data type (not just format) of the column to decimal number, it seems to work, at least in my simple table.

 

Hm, I'm wondering why you use CALCULATE(...), this creates a context transition meaning, transforming the exsisting row context (the current row, as you are creating a calculated column) into a filter context. Basically each column value of your table will act as a filter value. This means, if your table contains a row identifier, just one row is used to calculate PERCENTILE.INC.

 

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

I'm not sure what exactly is going on, but as I change the data type (not just format) of the column to decimal number, it seems to work, at least in my simple table.

 

Hm, I'm wondering why you use CALCULATE(...), this creates a context transition meaning, transforming the exsisting row context (the current row, as you are creating a calculated column) into a filter context. Basically each column value of your table will act as a filter value. This means, if your table contains a row identifier, just one row is used to calculate PERCENTILE.INC.

 

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thanks! THis solves my problem. Somehow I have to change the source column to decimal to get rid of the error. Not sure if it's a bug or something.

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!