Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Need Help DirectQueryUnexpectedEndofStream - Power BI Desktop

While apply the Dataset in my data model I'm getting the below error:

We are unable to apply the datamodel so please help me some to fix the issue:

Unexpected error: Internal error DirectQueryUnexpectedEndOfStream.
Details:
Microsoft.Mashup.Evaluator.Interface.ErrorException: Internal error DirectQueryUnexpectedEndOfStream. ---> Microsoft.ServicePlatform.Exceptions.Common.Runtime.ValidationFailedException: Internal error DirectQueryUnexpectedEndOfStream. ---> Microsoft.ServicePlatform.Exceptions.Common.Runtime.ValidationFailedException: Internal error DirectQueryUnexpectedEndOfStream.
at Microsoft.ServicePlatform.Exceptions.Core.Check.ThrowValidationFailedException(ServicePlatformErrorCode errorCode,MessageClass messageClass,Object[] messageParameters)
at Microsoft.Dataflows.Core.Platform.Transport.ReadWithCertaintyStream.Read(Byte[] buffer,Int32 offset,Int32 count)
at Microsoft.PowerBI.DataMovement.Pipeline.OleDbBase.Serialization.PageReader.Read(Byte[] buffer,Int32 offset,Int32 count)
at Microsoft.PowerBI.DataMovement.Pipeline.OleDbBase.Serialization.PageReader.ReadChars(Int32 count)
at Microsoft.PowerBI.DataMovement.Pipeline.OleDbBase.Serialization.PageReader.ReadArray(String[] values,Int32 offset,Int32 count)
at Microsoft.PowerBI.DataMovement.Pipeline.OleDbBase.Serialization.ColumnsPage.Deserialize(PageReader reader)
at Microsoft.Dataflows.Core.Platform.Transport.PagingDataReader.ReadNewPage()
at Microsoft.Dataflows.Core.Platform.Transport.PagingDataReader.Read()
at Microsoft.Mashup.Engine1.Library.Common.TracingDbDataReader.Read()
at Microsoft.Mashup.Engine1.Library.Common.ProgressDbDataReader.Read()
at Microsoft.Mashup.Engine1.Library.Common.DbData+CachingDbDataReader+<>c__DisplayClass48_0.<WrappedRead>b__0()
at Microsoft.Mashup.Engine1.Library.Common.DbValueBuilder+PageCachingEnumerator.WrapWithTracingAndDbExceptionHandling(Action action)
at Microsoft.Mashup.Engine1.Library.Common.DbData+CachingDbDataReader.WrappedRead()
at Microsoft.Mashup.Engine1.Library.Common.DbData+CachingDbDataReader.Read()
at Microsoft.Mashup.Engine1.Library.Common.DbValueBuilder+PageCachingEnumerator.MoveNext()
at Microsoft.Mashup.Engine1.Runtime.SkipTakeEnumerator`1.MoveNext()
at Microsoft.Mashup.Engine1.Library.Common.DbValueBuilder+PagingEnumerator.MoveNext()
at Microsoft.Mashup.Engine1.Runtime.SkipTakeEnumerator`1.MoveNext()
at Microsoft.Mashup.Engine1.Library.Table.TableModule+Table+AddIndexColumnFunctionValue+AddIndexColumnTableValue+AddIndexColumnEnumerator.MoveNext()
at Microsoft.Mashup.Engine1.Language.Query.JoinAlgorithm+JoinPrologue.Read(JoinParameters parameters,Boolean readLeft,Boolean readRight)
at Microsoft.Mashup.Engine1.Language.Query.JoinAlgorithm+DynamicJoinAlgorithm+DynamicJoinEnumerable.GetEnumerator()
at Microsoft.Mashup.Engine1.Language.Query.GroupQuery+GroupEnumerable.GetEnumerator()
at Microsoft.Mashup.Engine1.Language.Query.ProjectColumnsQuery+SelectColumnsEnumerable.GetEnumerator()
at Microsoft.Mashup.Engine1.Language.Query.ProjectColumnsQuery+SelectColumnsEnumerable.GetEnumerator()
at Microsoft.Mashup.Engine1.Language.Query.QueryTableValue.GetEnumerator()
at Microsoft.Mashup.Engine1.Language.Query.SkipTakeEnumerable.GetEnumerator()
at Microsoft.Mashup.Engine1.Language.Query.ProjectColumnsQuery+SelectColumnsEnumerable.GetEnumerator()
at Microsoft.Mashup.Engine1.Language.Query.IndexNestedJoinAlgorithm.Join(NestedJoinParameters parameters)
at Microsoft.Mashup.Engine1.Language.Query.QueryTableValue.GetEnumerator()
at Microsoft.Mashup.Engine1.Runtime.TableValue.Microsoft.Mashup.Engine.Interface.ITableValue.GetEnumerator()
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator+ValuePreviewValueSource+TableValuePreviewValueSource.SerializeRows(Int32 count)
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator+ValuePreviewValueSource+TableValuePreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource+<>c__DisplayClass0_0.<RunStub>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(String entryName,IEngineHost engineHost,IMessageChannel channel,Action action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator+Service+<>c__DisplayClass12_0`1.<OnBeginGetResult>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace,IEngineHost engineHost,IMessageChannel channel,Action action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator+Service.OnBeginGetResult(IMessageChannel channel,BeginGetResultMessage message,Action`1 action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator+Service.OnBeginGetPreviewValueSource(IMessageChannel channel,BeginGetPreviewValueSourceMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel,Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger+ChannelMessageHandlers.TryDispatch(IMessageChannel channel,Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel,Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel,MessageWithUnknownChannel messageWithUnknownChannel)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel,Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger+ChannelMessageHandlers.TryDispatch(IMessageChannel channel,Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel,Message message)
at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
at Microsoft.Mashup.Evaluator.SafeThread2+<>c__DisplayClass9_0.<CreateAction>b__0(Object o)
at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)

--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass17_0.<TryReportException>b__1()
at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost host, IHostTrace trace, Action action)
at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(String entryName, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass12_0`1.<OnBeginGetResult>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)
at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)

 

==================================================

Merging from:

let
Source = PowerPlatform.Dataflows([]),
Workspaces = Source{[Id="Workspaces"]}[Data],
#"4f52abfa-0e4d-49dc-b983-0437ac27d269" = Workspaces{[workspaceId="4f52abfa-0e4d-49dc-b983-0437ac27d269"]}[Data],
#"32add47e-8f07-4f5b-a0b2-38b367bc96b8" = #"4f52abfa-0e4d-49dc-b983-0437ac27d269"{[dataflowId="32add47e-8f07-4f5b-a0b2-38b367bc96b8"]}[Data],
UAP_ = #"32add47e-8f07-4f5b-a0b2-38b367bc96b8"{[entity="UAP",version=""]}[Data],
#"Removed Other Columns" = Table.SelectColumns(UAP_,{"USER_ID", "ORG_VALUE"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Other Columns", each [USER_ID] <> null and [USER_ID] <> ""),
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each [ORG_VALUE] <> null and [ORG_VALUE] <> ""),
#"Removed Duplicates" = Table.Distinct(#"Filtered Rows1")
in
#"Removed Duplicates"

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

This query seems well-structured and should work under normal circumstances.
There is a data flow refresh issue related to this:

DirectQueryUnexpectedEndOfStream

I will come back with updates if there is any progress .

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

So basically for me it was failing for a table/query where two tables were being merged. Basically Table1 was doing query folding and Table2 was not, in this case the merge will fail. Make sure either both tables / dataflows are using query folding and are in the same workspace (if using Dataflows). This helped me hope it helps you too.

Anonymous
Not applicable

Hi @Anonymous 

This query seems well-structured and should work under normal circumstances.
There is a data flow refresh issue related to this:

DirectQueryUnexpectedEndOfStream

I will come back with updates if there is any progress .

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

amitchandak
Super User
Super User

@Anonymous , Clear permission for Data Source Under Hoem Tab -> Transform Data -> Data Source setting

 

And try again.

 

If this does not help

Log an issue- https://community.powerbi.com/t5/Issues/idb-p/Issues

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors