Forum Discussion

vinayrk's avatar
vinayrk
Regular Visitor
6 years ago
Solved

Unable to create SQL DB view

Hi ,

 

I have an sample table which needs to have the following modifications.

 

1) Replace -1 to Null on an column priority column

2)  Change data format to date on Datacreated column

 

While I was able to create these 2.  I'm unable to create the view with Alias prepended into the columns.  Screenshots attached.

 

Any Ideas on how to create an view on the DB end to prepend the alias name to each column.

 

Original Table :

 

PowerBI Transformation

 

 

 

Need to recreate the powerbi transformation on the DB end.

3 Replies

    • vinayrk's avatar
      vinayrk
      Regular Visitor

      Hi Amit, 

       

      I'm clear on how to replace values and change data part.   I'm making those changes on the DB side.

       

      What im not able to create is an view of the original table with the alias name prepended into each column. 

       

      I want to recreate the table structure that was in powerBi on the DB end.  This is how it looks in the current PBI report.

       

      // Expand the table to multiple columns, and prepend a table alias to each field name.
      TableData = Table.ExpandRecordColumn(SingleColumnTable, "Column1", {
      "assetId",
      "organizationId",
      "dateCreated",
      "dateModified",
      "installDate",
      "manufacturer",
      },
      {
      "a.assetId",
      "a.organizationId",
      "a.dateCreated",
      "a.dateModified",
      "a.installDate",
      "a.manufacturer",
      })

       

      We have been asked to make this calculation run on the DB end rather than powerbi.  Our view on the DB end is missing a."column name"  which we are unable to recreate