Forum Discussion

Marcky's avatar
Marcky
Frequent Visitor
3 years ago

This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the PBI

 

The error Occurs when refreshing in Power BI Service but when refreshing in Power BI Desktop its working perfectly fine.

 

This is the code.

----------------------------------

let

    Source = PowerBI.Dataflows([]),

    #"72da37b2-4dc9-43ac-819d-6c0de9ff51bf" = Source{[workspaceId="72da37b2-4dc9-43ac-819d-6c0de9ff51bf"]}[Data],

    #"9b1df221-93b4-4967-83ed-a10470a9275e" = #"72da37b2-4dc9-43ac-819d-6c0de9ff51bf"{[dataflowId="9b1df221-93b4-4967-83ed-a10470a9275e"]}[Data],

    Projects1 = #"9b1df221-93b4-4967-83ed-a10470a9275e"{[entity="Projects"]}[Data],

    #"Removed Other Columns" = Table.SelectColumns(Projects1,{"ProjectId", "ProjectName", "ProjectWorkspaceInternalUrl", "EnterpriseProjectTypeName", "State"}),

    #"Filtered Rows" = Table.SelectRows(#"Removed Other Columns", each [EnterpriseProjectTypeName] = "Project" or [EnterpriseProjectTypeName] = "Product"),

    #"Filtered Rows5" = Table.SelectRows(#"Filtered Rows", each not Text.StartsWith([ProjectName], "zz")),

    #"Filtered Rows4" = Table.SelectRows(#"Filtered Rows5", each [ProjectName] <> null and [ProjectName] <> ""),

    #"Filtered Rows1" = Table.SelectRows(#"Filtered Rows4", each [EnterpriseProjectTypeName] <> null and [EnterpriseProjectTypeName] <> ""),

    #"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", each ([ProjectWorkspaceInternalUrl] <> null and [ProjectWorkspaceInternalUrl] <> "") and ([State] = "4_Active")),

    LoadIssues2 = (site as text) =>

        let

            Source = OData.Feed(site&"/_api/web/lists/GetByTitle('Issues')/Items()?")

        in

            Source,

 

    #"Added Custom" = Table.AddColumn(#"Filtered Rows2", "GetIssueData", each LoadIssues2([ProjectWorkspaceInternalUrl])),

    #"Expanded GetIssueData" = Table.ExpandTableColumn(#"Added Custom", "GetIssueData", {"FieldValuesAsText"}, {"FieldValuesAsText"}),

    #"Expanded FieldValuesAsText" = Table.ExpandRecordColumn(#"Expanded GetIssueData", "FieldValuesAsText", {"ID", "Title", "Owner", "AssignedTo", "Status", "Priority", "DueDate", "Discussion", "Resolution", "Description", "Escalation_x0020_Level"}, {"ID", "Title", "Owner", "AssignedTo", "Status", "Priority", "DueDate", "Discussion", "Resolution", "Description", "Escalation_x0020_Level"}),

    #"Filtered Rows3" = Table.SelectRows(#"Expanded FieldValuesAsText", each ([Status] = "(1) Active"))

in

    #"Filtered Rows3"

3 Replies