microsoft / Analysis-Services

Git repo for Analysis Services samples and community projects
MIT License
588 stars 411 forks source link

fabricps-pbip: issue with calculated columns after publishing #262

Open arexms opened 3 months ago

arexms commented 3 months ago

Hello,

I'm trying to use fabricps-pbip module to automaitze reports publishing. Looks ok, but unfortunately I have an issue with semantic model which consist of calculated column.

Screen of simplified report to reproduce issue: image

Command used to publish semantic model (I also tried with Import-FabricItems) Import-FabricItem -workspaceId "xxx" -path "tmp.SemanticModel"

After model is published, I'm trying to check CalculatedColumn values but unfortunatelly I got an error: image

When I'm publishing via PowerBI Desktop - everything is fine.

PowerBI version: image

Any clue?

RuiRomano commented 3 months ago

It's by design. Publishing a PBIP files (through Fabric API or Git Integration) only metadata gets published and not the data (residing in the cache.abf file). You must refresh the semantic model in the workspace after publishing. (Note: next publish will retain the data, you only need to refresh at least once)

arexms commented 3 months ago

@RuiRomano this was the first thing I did when I got this error message but it didn't help (even for the simplified example that I created).

There is one thing that I didn't mention - my semantic model is in Direct Mode. Does fabricps-pbip support this mode?

arexms commented 3 months ago

@RuiRomano any comment from your side?

You closed this issue without any discussion and confirmation from my side... How can I refresh semantic model in direct mode? There is no such thing... or am I wrong and you meant different kind of refresh?

RuiRomano commented 3 months ago

Sorry, I reopened the issue.

Can you elaborate on what you mean by 'direct mode'? Direct Query? Direct Lake?

arexms commented 3 months ago

Thank you.

Yes, storage mode = Direct Query. I have all tables in my semantic model in DirectQuery.

RuiRomano commented 3 months ago

Thanks, was able to repro and looks like a bug in Fabric Git and Fabric REST APIs.

I'll review internally and get back to you when I know more.

arexms commented 3 months ago

Great. Thank you for your analysis!

arexms commented 2 months ago

Hello @RuiRomano,

I contacted with MS about this, and finally they confirmed that it is a bug, probably with Fabric API. ETA not yet know.

Tikcet no 2406110050000429

In the meantime I found 2 workarounds. (maybe will be helpful also for you)

  1. Create artificial table in the semantic model so whole model will be in composite mode (not purely in direct query). This gives me a possibility to make a refresh of a model and solve the issue.
  2. After fresh publication of a semantic model, run Fabric API updateDefinition with exactly the same data POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/semanticModels/{semanticModelId}/updateDefinition Looks like updateDefinition does not have this issue.
RuiRomano commented 2 months ago

Thanks for the feedback. The team is still looking into this, I'll update when I know more. Another workaround is executing a Process Recalc on the semantic model, using XMLA endpoint.

arexms commented 2 weeks ago

Hello @RuiRomano,

Unfortunately MS archived my ticket due to the unknown timeline...

Bug description: Our product team has thoroughly investigated the problem and identified that the issue lies within the AS Engine. Specifically, the service refresh is being skipped for the Direct Query model because the calculated column does not contribute to the cache/import attribute within the model metadata stored in Power BI.