Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi, I am trying out the new AI capabilities of Power BI but I am running into some weird errors, that I can't make sense of.
I am running this tutorial: https://docs.microsoft.com/en-us/power-bi/service-tutorial-build-machine-learning-model
Everything goes well with quering, creating a ML model and up until the "Refresh the dataflow" part of the tutorial.
Where it gives me the following error report. Can anyone make sense of this, and what I am doing wrong?
| Run time | Dataflow name | Dataflow refresh status | Entity name | Start time | End time | Entity refresh status | Error |
| 15-04-2019 13:53 | Online Shoppers Intent | Failed | Online Visitor | 15-04-2019 13:53 | 15-04-2019 13:53 | Completed | |
| 15-04-2019 13:53 | Online Shoppers Intent | Failed | Purchase Intent Prediction | 15-04-2019 13:53 | 15-04-2019 13:53 | Failed | Error: One or more upstream operations failed... RootActivityId = 5d8a6495-df6f-425b-8dbd-8188366137d1 Request ID: 1e6fe497-30b3-5707-42ca-285f1747a7ff. |
| 15-04-2019 13:53 | Online Shoppers Intent | Failed | Purchase Intent Prediction Training Data | 15-04-2019 13:53 | 15-04-2019 13:53 | Failed | Error: An internal error occurred... RootActivityId = 5d8a6495-df6f-425b-8dbd-8188366137d1.Param1 = An error happened while reading data from the provider: '{"error":{"code":"UnknownError" "pbi.error":{"code":"UnknownError" "parameters":{} "details":[]}}}' Request ID: 1e6fe497-30b3-5707-42ca-285f1747a7ff. |
| 15-04-2019 13:53 | Online Shoppers Intent | Failed | Purchase Intent Prediction Testing Data | 15-04-2019 13:53 | 15-04-2019 13:53 | Failed | Error: One or more upstream operations failed... RootActivityId = 5d8a6495-df6f-425b-8dbd-8188366137d1 Request ID: 1e6fe497-30b3-5707-42ca-285f1747a7ff. |
I'm having exactly the same issue. There seems to be an issue with the "AI.SampleStratifiedWithHoldout" function in the Power Query Editor.
I've added a detaile error message, maybe it makes sense for someone:
DataSource.Error: An error happened while reading data from the provider: '{"error":{"code":"UnknownError","pbi.error":{"code":"UnknownError","parameters":{},"details":[]}}}'
section Section1;
shared #"Online Visitor" = let
Source = Csv.Document(Web.Contents("https://raw.githubusercontent.com/santoshc1/PowerBI-AI-samples/master/Tutorial_AutomatedML/online_shoppers_intention.csv"), [Delimiter = ",", Columns = 18, QuoteStyle = QuoteStyle.None]),
#"Promoted headers" = Table.PromoteHeaders(Source, [PromoteAllScalars = true]),
#"Changed column type" = Table.TransformColumnTypes(#"Promoted headers", {{"Administrative_Duration", type number}, {"Informational_Duration", type number}, {"ProductRelated_Duration", type number}, {"BounceRates", type number}, {"ExitRates", type number}, {"PageValues", type number}, {"SpecialDay", type number}, {"Weekend", type logical}, {"Revenue", type logical}})
in
#"Changed column type";
shared #"Purchase Intent Prediction Training Data" = let
Source = #"Online Visitor",
#"Selected columns" = Table.SelectColumns(Source, {"Administrative", "Administrative_Duration", "Informational", "Informational_Duration", "ProductRelated", "ProductRelated_Duration", "BounceRates", "ExitRates", "PageValues", "SpecialDay", "Month", "OperatingSystems", "Browser", "Region", "TrafficType", "VisitorType", "Weekend", "Revenue"}),
#"Removed nulls" = Table.SelectRows(#"Selected columns", each [Revenue] <> null),
#"Sampled input" = AI.SampleStratifiedWithHoldout("Revenue", Table.RowCount(#"Removed nulls"), #"Removed nulls")
in
#"Sampled input";
shared #"Purchase Intent Prediction" = let
Source = #"Purchase Intent Prediction Training Data",
#"Invoked TrainPrediction" = AIInsights.Contents(){[Key = "AI.Execute"]}[Data]("AI.TrainPrediction", "Regular", [labelColumnName = "Revenue", data = Source]),
#"Selected training schema columns" = Table.SelectColumns(#"Invoked TrainPrediction", {"TrainingId", "Model", "Stats", "GlobalExplanation", "TrainingSchema", "TrainingAUC", "LabelColumn"})
in
#"Selected training schema columns";
shared #"Purchase Intent Prediction.Score" = let
ApplyScoringFunction = (inputQuery as table, newColumn as text, decisionThreshold as number) => let
MlModel = #"Purchase Intent Prediction",
MlModelJson = try Text.FromBinary(Json.FromValue(MlModel{0})) otherwise "InvalidModel",
Source = inputQuery,
SelectedBaseEntityColumns = {"Administrative", "Administrative_Duration", "Informational", "Informational_Duration", "ProductRelated", "ProductRelated_Duration", "BounceRates", "ExitRates", "PageValues", "SpecialDay", "Month", "OperatingSystems", "Browser", "Region", "TrafficType", "VisitorType", "Weekend", "Revenue"},
InputRowCount = Table.RowCount(Source),
InputTableType = Value.Type(Source),
SelectedColumnsTypes = List.Transform(SelectedBaseEntityColumns, each Type.TableColumn(InputTableType, _)),
ScoringFunction =
let
ScoringFunctionScalarType = type function (row as record) as any,
VectorizedScoringFunction = (input as table) =>
let
ExpandedColumns = Table.ExpandRecordColumn(input, "row", SelectedBaseEntityColumns),
ExpandedColumnsWithTypes = Table.TransformColumnTypes(ExpandedColumns, List.Zip({SelectedBaseEntityColumns, SelectedColumnsTypes})),
ErrorList = List.Repeat({[Output = null]}, InputRowCount),
Result = if MlModelJson <> "InvalidModel" then (try Table.ToRecords(AIInsights.Contents(){[Key = "AI.Execute"]}[Data]("AI.ScorePrediction", "Vectorized", [data = ExpandedColumns, scoreParameters = MlModelJson])) otherwise ErrorList) else ErrorList
in
Result,
ScalarVectorScoringFunction = Function.ScalarVector(ScoringFunctionScalarType, VectorizedScoringFunction)
in
ScalarVectorScoringFunction,
AddScoringColumn = Table.AddColumn(Source, newColumn, each ScoringFunction(_)),
ExpandResultColumns = Table.ExpandRecordColumn(AddScoringColumn, newColumn, {"PredictionScore", "PredictionExplanation"}, {Text.Combine({newColumn, "PredictionScore"}, "."), Text.Combine({newColumn, "PredictionExplanation"}, ".")}),
LabeledOutput = Table.AddColumn(ExpandResultColumns, Text.Combine({newColumn, "Outcome"}, "."), each Record.Field(_, Text.Combine({newColumn, "PredictionScore"}, ".")) >= decisionThreshold * 100),
ReplacedErrors = Table.ReplaceErrorValues(LabeledOutput, {{Text.Combine({newColumn, "Outcome"}, "."), null}, {Text.Combine({newColumn, "PredictionScore"}, "."), null}, {Text.Combine({newColumn, "PredictionExplanation"}, "."), null}}),
TransformTypes = Table.TransformColumnTypes(ReplacedErrors, {{Text.Combine({newColumn, "Outcome"}, "."), type logical}, {Text.Combine({newColumn, "PredictionScore"}, "."), type text}, {Text.Combine({newColumn, "PredictionExplanation"}, "."), type text}})
in
TransformTypes
in
ApplyScoringFunction;
shared #"Purchase Intent Prediction_PollingQuery" = let
Source = "536eb714-1488-49b5-9ac6-598e40d1780b"
in
Source;
shared #"Purchase Intent Prediction Testing Data" = let
Source = #"Purchase Intent Prediction Training Data",
#"Filtered rows" = Table.SelectRows(Source, each ([__IsTraining__] = false)),
#"Invoked Scoring" = #"Purchase Intent Prediction.Score"(#"Filtered rows", "Purchase Intent PredictionOutput", 0.5)
in
#"Invoked Scoring";
shared #"Purchase Intent Prediction Preview" = let
Source = PowerBI.Dataflows(),
Workspace = Source{[workspaceId = "94fe567d-5d7c-496c-85c7-30650d1271ce"]}[Data],
Dataflow = Workspace{[dataflowId = "90099937-edac-4f34-8f73-3fca50551482"]}[Data],
Preview = Dataflow{[entity = "Purchase Intent Prediction"]}[Data]
in
Preview;
shared #"Purchase Intent Prediction Testing Data Preview" = let
Source = PowerBI.Dataflows(),
Workspace = Source{[workspaceId="94fe567d-5d7c-496c-85c7-30650d1271ce"]}[Data],
Dataflow = Workspace{[dataflowId="90099937-edac-4f34-8f73-3fca50551482"]}[Data],
Preview = Dataflow{[entity="Purchase Intent Prediction Testing Data"]}[Data]
in
Preview;
Is it resolved?
Bump
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.