Forum Discussion

ZineBakh's avatar
ZineBakh
Frequent Visitor
7 years ago
Solved

Getting Key instead of text from SAP HANA (New issue with Power bi July 2022)

Hello team, please be informed that there were a new issue with the latest PBI version. it turned the Cube.AttribID in PowerQuery to Blank. Anyone is facing the same?

  • The existing functionality of the Power BI Connector for SAP HANA only exposes text values. To get the Key values after you have loaded the required columns from Hana, we need to be in the Query Editor, then go to Add Column Add Custom Column. Then double click on the column that we need to pull the Key values from. If the column name is Customer, then you will see = [Customer] in the Custom Column Formula box. After that’s done, replace it with the following: Cube.AttributeMemberId([Customer]).

14 Replies

  • ZineBakh's avatar
    ZineBakh
    Frequent Visitor

    The existing functionality of the Power BI Connector for SAP HANA only exposes text values. To get the Key values after you have loaded the required columns from Hana, we need to be in the Query Editor, then go to Add Column Add Custom Column. Then double click on the column that we need to pull the Key values from. If the column name is Customer, then you will see = [Customer] in the Custom Column Formula box. After that’s done, replace it with the following: Cube.AttributeMemberId([Customer]).

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Icon for Administrator rankAdministrator

      Hi! I followed these steps but I'm getting a null response for each record... how should I fix this?

      Captura2.PNG

      Captura.PNG

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi! I followed these steps but I'm getting a null response for each record... how should I fix this?

    • FP's avatar
      FP
      Frequent Visitor

      Hi, I have the same issue and I tryied with your solution, but sadly - as the other reply below - I received only "null" insead of the key values.

      Should we do something else to make the solution work properly ?

      • ZineBakh's avatar
        ZineBakh
        Frequent Visitor

        Hi - this is a new issue happened with the new July version, not sure if Microsoft are aware about it. but I heard a lot of people having the same issue. the old cube.attribute.ID PowerQuery formula does not function anymore. not sure if this formula got retired and there is another new one or it is just a bug.

  • jjgb's avatar
    jjgb
    Icon for Microsoft Employee rankMicrosoft Employee

    There was a bug in the July 2022 release of Power BI Desktop / Gateway that produced null values when adding a column that used the Cube.AttributeMemberId function.

     

    This issue has been fixed in Power BI Desktop August 2022 version 2.108.997.0.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Any updates on this ? I get the same trouble with BW. But our prefrence is to use Direct Query which makes impossible to get to Power Query..

  • Anonymous's avatar
    Anonymous
    Not applicable

    Update on the understanding on this issue so far:

    Caused by the HANA View being setup with an "alternative column" in the 'Label Column' entry. It looks like this functionality exists to support Parameters shwoing a "alternative column name" like an aid when selecting a Parameter input. There is no way for user to see this design setup. Your org can screen all the views that have entries in this 'Label Column', and maybe decide to clear them (pending understanding why they are used in the first place).

     

    Preventive action: HANA designers should never use 'Label Column' functionality in a Consumption View, only in Re-useable views where the Parameter comes from. Using in Consumption view will disrupt column for user, showing values of referenced Label Column instead of actual column when pulled through PowerQuery. 

     

    See the screenshot of the design: 

     

    The PowerBI SAP HANA Connector BY DESIGN pulls the Key instead of the Text. So somehow, the View is desinged in such a way to result in this issue. My Organization has listed this to Microsoft as a Ticket / Bug. Issue does not apear in Tableau or in Hana Studio. They pointed me, as the initiator, to this workaround. 

    Result for user: 

     

    Example of a Parameter input with an  2nd information column (‘description column’): 

  • You need to be using PBI Desktop and Gatway version that is not from JULY 2022. Otherwise you will have problems in Desktop and Service. I've just downgraded to JUNE 2022 version of Gateway and it solved the issue.

  • ZineBakh's avatar
    ZineBakh
    Frequent Visitor

    This issue is still current in Aug version, hopefully they will fix it in the next new version. as of now, I'm using PBI May version and it works fine for me.

    • jjgb's avatar
      jjgb
      Icon for Microsoft Employee rankMicrosoft Employee

      The issue I mentioned was introduced in the July 2022 release and affects Calculation Views in HANA 2.0+ servers. Note that the original issue in this thread is really by design, if that's related to your case please refer to the other posts for alternatives.

       

      If your scenario works in the May version but is now broken in the August version, I'd be interested to know more. For that I'd need to see:

      1. The affected Mashup query (copied from the advanced editor)

      2. Right click on the last step of the query in the May 2022 version, select View Native Query and share the query.

      3. Right click on the last step of the exact same query in the August 2022 version (make sure it's version 2.108.997.0), select View Native Query and share the query.

      4. Is it an analytical view or calculation view? What's the HANA server version?

       

      If you don't feel comfortable sharing the information above here, it's probably best to open an incident through Microsoft support. Ideally, I'd ask for traces / query plan of the queries to investigate.