Forum Discussion

nioj2S2's avatar
nioj2S2
Frequent Visitor
2 years ago
Solved

Adding index column based on another query, issues with data types

Hello! I am trying to do a workaround for the missing IDENTITY column in my Fabric warehouse in order to have a surrogate key.   In the DW I have column [surrogateKey] in the empty accounts tabl...
  • miguel's avatar
    2 years ago

    are any of your queries set to be staged? specifically the MaxKey_Accounts query

  • miguel's avatar
    miguel
    2 years ago

    when you stage a query it needs to be saved as a table. If you had a scalar value, like a number, simply referring to that query would yield the scalar value (Number). However, if its a table (like it was in this case because the query was staged) then you'd need to do the table navigation to reach the value that you're looking for. It could be something like QueryName[ColumnName]{0} where the 0 indicates that you just want the first row.

    Number.From works against scalar values and not complex ones (like records, tables, lists and such). More info on the signature of the function below: 

    Number.From - PowerQuery M | Microsoft Learn