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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Exporting to PDF does not wait till visuals are loaded

Hello, 

 

When Exporting to PDF from Power BI Desktop, I noticed that it seems as if the program is taking a screen shot of each page which it uses as the output image for PDF. 

 

One problem which i noticed is that the porgram does not let all the visuals on the page load first before taking the screenshot causing the image to be missing data. 

 

 

Please let me know your thoughts

 

Kind Regards

 

Piri

Status: New
Comments
mateuskinasz
New Member

More than 2 years and I am having the same problem.

Anonymous
Not applicable

Same issue here! visuals are appearing as blank in the pdf, because export does not wait for complete loading of them!

Really need to be solved, otherwise we have to repeat exporting each page separately one by one! 

Anonymous
Not applicable

Hi, 

I also have experienced this problem, but with the new paginated report visual.  For everyone here looking for a solution, I have an extremely dumb workaround if the ultimate goal is to export to PDF (and not user experience).

I have a suspicion that PBI looks at the calculation engine to determine if the page is ready for export or not.  With the ESRI map and the new Paginated Report visual, the loading is not happening in the calculation engine (it's pulling from web sources, you can see how long it takes to evaluate in the calculation engine via the Performance Analyzer pane), so PBI doesn't know that the visuals have not finished loading.
My workaround is to make a measure that takes a long time to evaluate in the calculation engine and put it somewhere on the sheet.  This way, Power BI will wait until that measure has finished calculating before it takes the snapshot for PDF export.  Here's the measure I used.  On my computer it takes ~60 seconds to evaluate which is enough time for the paginated report visual to populate before exporting.  You can adjust the WaitFactor variable which controls the number of rows that are cross joining for more or less waiting time.

 

Export Wait = 
VAR WaitFactor = 10000
RETURN
COUNTX(
    CROSSJOIN(
        SELECTCOLUMNS(GENERATESERIES(1,WaitFactor),"Value1",[Value]),
        SELECTCOLUMNS(GENERATESERIES(1,WaitFactor),"Value2",[Value])),
   [Value2]*[Value1]
)

 

You will need to hit refresh before you export to PDF in order to have the measure recalculating as the export happens (instead of using a cached value).

Jujo95
Frequent Visitor

Hi @Anonymous  could u tell me how to do that?. I'm new at Power Bi , and I don't know how exactly apply the code u show. I'll apreciate it so much if u can help me.

philipe_rodrigo
Frequent Visitor

Please, solution?

beldroegas
Regular Visitor

Hey Anonymous' solutions works for me, just create this measure, put it somewhere behind a chart where it's invisible and it works. thank you!!!

Export Wait = 
VAR WaitFactor = 10000
RETURN
COUNTX(
    CROSSJOIN(
        SELECTCOLUMNS(GENERATESERIES(1,WaitFactor),"Value1",[Value]),
        SELECTCOLUMNS(GENERATESERIES(1,WaitFactor),"Value2",[Value])),
   [Value2]*[Value1]
)

 

sdft
Regular Visitor

It sure would be nice to have an actual built in fix for this, or to at least know it is in the works

Kick
New Member

Reporting in for Q3 2023 that this is still a problem.