Forum Discussion

BiBra's avatar
BiBra
Helper III
8 years ago

Expression error type text

Hello 

i get Expression.Error: we cannot apply field access on type Text.

 

I have the following code:

 

let
    Source = Excel.Workbook(File.Contents("C:xx"), null, true),
    #"Product Sales_Sheet" = Source{[Item="Product Sales",Kind="Sheet"]}[Data],
    #"DistinctSource" = List.Distinct("Product Sales"[Date])
in
    DistinctSource

Can anyone help me figure out where I'm going wrong?

 

 

2 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi BiBra,

     

    Please try this:

    let
        Source = Excel.Workbook(File.Contents("C:xx"), null, true),
        #"Product Sales_Sheet" = Source{[Item="Product Sales",Kind="Sheet"]}[Data],
        #"DistinctSource" =Table.Distinct(#"Product Sales_Sheet",{"Date"})

    in
    #"DistinctSource"

     

    Best regards,

    Yuliana Gu