none
Application Insights is not returning correct data in PowerBI

    Question

  • Hello,

    I am connecting with Application Insights using  PowerBI, but I am not able to get the last 90 days data.

    I am getting data from 26-OCT-2018 to Today's date but it should be from 08-Sep-2018 to Today's date.

    I am using the below query for fetching the data.

    The row count that I am getting is for 90 days but somehow the timestamp column is not coming for 90 days.

    Can someone please help me in resolving this issue, Thanks in advance.

    Query : 

    let AnalyticsQuery =
    let Source = Json.Document(Web.Contents("https://api.loganalytics.io/v1/apps/c17ea4bf-77ec-4451-b0a1-10e46d0f39ff/query", 
    [Query=[#"query"="pageViews 
    ",#"x-ms-app"="AAPBI",#"timespan"="2018-09-08T09:38:21.000Z/2018-12-07T09:38:21.000Z",#"prefer"="ai.response-thinning=true"],Timeout=#duration(0,0,4,0)])),
    TypeMap = #table(
    { "AnalyticsTypes", "Type" }, 

    { "string",   Text.Type },
    { "int",      Int32.Type },
    { "long",     Int64.Type },
    { "real",     Double.Type },
    { "timespan", Duration.Type },
    { "datetime", DateTimeZone.Type },
    { "bool",     Logical.Type },
    { "guid",     Text.Type },
    { "dynamic",  Text.Type }
    }),
    DataTable = Source[tables]{0},
    Columns = Table.FromRecords(DataTable[columns]),
    ColumnsWithType = Table.Join(Columns, {"type"}, TypeMap , {"AnalyticsTypes"}),
    Rows = Table.FromRows(DataTable[rows], Columns[name]), 
    Table = Table.TransformColumnTypes(Rows, Table.ToList(ColumnsWithType, (c) => { c{0}, c{3}}))
    in
    Table
    in AnalyticsQuery

    Thanks,
    Rajendra

    Friday, December 7, 2018 5:24 AM

All replies

  • Hi Rajendra,

    Could you please help confirm if you are seeing the data from Sep 8th to till date in application insights analytics window ? By going to Application Insights instance -->  analytics page and running the pageViews query with custom time range.

    We have tried in one of our existing application insights instance with below query was able to get the result back both in Application Insights query window and also in PowerBI with timestamp.  

     

    let AnalyticsQuery =

    let Source = Json.Document(Web.Contents("https://api.loganalytics.io/v1/apps/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/query",

    [Query=[#"query"="pageViews",#"x-ms-app"="AAPBI",#"timespan"="2018-09-09T12:05:30.000Z/2018-12-11T20:05:30.586Z",#"prefer"="ai.response-thinning=true"],Timeout=#duration(0,0,4,0)])),

    TypeMap = #table(

    { "AnalyticsTypes", "Type" },

    {

    { "string",   Text.Type },

    { "int",      Int32.Type },

    { "long",     Int64.Type },

    { "real",     Double.Type },

    { "timespan", Duration.Type },

    { "datetime", DateTimeZone.Type },

    { "bool",     Logical.Type },

    { "guid",     Text.Type },

    { "dynamic",  Text.Type }

    }),

    DataTable = Source[tables]{0},

    Columns = Table.FromRecords(DataTable[columns]),

    ColumnsWithType = Table.Join(Columns, {"type"}, TypeMap , {"AnalyticsTypes"}),

    Rows = Table.FromRows(DataTable[rows], Columns[name]),

    Table = Table.TransformColumnTypes(Rows, Table.ToList(ColumnsWithType, (c) => { c{0}, c{3}}))

    in

    Table

    in AnalyticsQuery

    Screen shot from Application Insights Query page ( we have data ingestion done only from Sep 27th that's the reason you see the data from then)


    Screen shot from PowerBI query result


    20 hours 9 minutes ago