Forum Discussion

PBI_newbi87's avatar
PBI_newbi87
Regular Visitor
3 years ago
Solved

Connecting to SAP HANA View using direct query: data type cannot be converted to decimal

Hi there, 

 

I am new to PowerBI and ran into some trouble when using DirectQuery on a SAP HANA View. I was able to succesfully connect to the table (in relational mode, not multidimensional), but when I look at the data types few of them are incorrect, namely decimal numbers which are stored as Text. When I try to convert them to decimal numbers in Power Query Editor, I get a message saying that this action would result in a Query not supported in DirectQuery mode (Error message is in German, sorry) and the option to change to Import mode.

Any idea whether that is possible in DirectQuery mode on SAP HANA Views?

In Import mode the transformation works fine, but I was curious whether I just didn't get it right in DirectQuery mode or whether it was not possible at all?

 

Thanks in advance for your help/answers.

  • Hi, PBI_newbi87 

    After my tests, it is not possible to convert data in Text text format to number format in Direct Query:

    The main reasons are:
    In Direct Query mode, only some Power Query Editor features are supported, because data is not saved under Direct Query mode, and data is obtained directly from the data source, so query folding must be supported at each step.We can see that when we convert the character format to the number format, this step does not support query folding ("View Native Query" is grayed out)

    If you want to modify the data type, you can try modifying the field type on the data source side.

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

     

2 Replies

  • Hi, PBI_newbi87 

    After my tests, it is not possible to convert data in Text text format to number format in Direct Query:

    The main reasons are:
    In Direct Query mode, only some Power Query Editor features are supported, because data is not saved under Direct Query mode, and data is obtained directly from the data source, so query folding must be supported at each step.We can see that when we convert the character format to the number format, this step does not support query folding ("View Native Query" is grayed out)

    If you want to modify the data type, you can try modifying the field type on the data source side.

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

     

    • PBI_newbi87's avatar
      PBI_newbi87
      Regular Visitor

      Hi Aniya

       

      Thanks a lot for the clarification. In this case I will continue to work in import mode. 

      Have a nice day!