Forum Discussion

B_Real's avatar
B_Real
Icon for Advocate IV rankAdvocate IV
9 years ago
Solved

Calculated table 'Tablename' results in a variant data type for column 'Percentile'

I'm creating a new table based on a fact table. My calculation for the new table is broadly:   Tablename = SUMMARIZE('Fact Table',Facility[Facility Name],'Scheduled Date'[Scheduled Date].[Date], ...
  • v-qiuyu-msft's avatar
    9 years ago

    Hi B_Real,

     

    Please see below response from PG team:

     

    All columns in a physical table include calculated tables must have a specific data type like Integer, Double, String, Boolean, etc. Variant data type is not allowed as Vertipaq engine doesn’t support variant data types therefore cannot store the values of such a column. Percentile.Exc function may return a variant data type, for example, if [Time in Seconds] is of Integer data type, the Percentile.Exc function either returns an Integer value directly from the original column or returns a Double value when interpolation is required. To force Percentile.Exc to return Double values only, either change the data type of the column [Time in Seconds] to Numeric or use PercentileX.Exc([Time in Seconds] * 1.0, 0.95) to always force the first argument to Double at calculation time. Note that this constraint doesn’t apply to measures which can return variant data type.

     

    In your scenario, please set the data type of the 'Fact Table'[Time in Seconds] as Decimal number, or replace the part PERCENTILE.EXC('Fact Table'[Time in Seconds],0.95) as PERCENTILEX.EXC('Fact Table','Fact Table'[Time in Seconds]*1.0,0.95)

     

    Best Regards,
    QiuyunYu