Search code examples
excelssasmdxpowerpivot

MDX -> Query works in CubeBrowser not PowerPivot -> "unable to cast object of type 'system.dbnull' to type 'system.string'"


Pasting query into powerpivot produces the following error but works in CubeBrowser. : "unable to cast object of type 'system.dbnull' to type 'system.string'"

Here is my query.

SELECT NON EMPTY { [Measures].[Revenue],  [Measures].[PrevDayRevenue], [Measures].[RANKRevenuePrevOrder], [Measures].[RANKRevenueCurrOrder] } ON COLUMNS,

NON EMPTY { ( [RevRankCurrOrder] ) } ON ROWS 

FROM [DW] 

WHERE {[Date Link].[PK Date].&[2012-01-10T00:00:00]}

I am just wondering if anyone has seen this issue before. I know that issues occur when pasting an MDX query into Excel and SSRS, but need to know if there is any way to fix this, etc.

Any help direction will be greatly appreciated.

Thanks.


Solution

  • I ended up fixing this by doing a calculated member that does a null check for my revenue. (using iif isEmpty)