This information has been around the blogosphere for a while but I keep forgetting how to find it; I decided to write about it on my blog so that I can easily find it next time I need it.
The existing functionality of the Power BI Connector for SAP BW only exposes text values of BW objects. To get the Key values after you have loaded the required columns from BW, 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]).