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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
rouzbehrasai
New Member

Power BI shows old years from REST API, while Postman & a fresh PBIX show correct data

Hi all,
I’m stuck with an odd caching issue when pulling JSON from a REST API via Web.Contents.

Context

  • Source: http://thestaff.co.in:8000/api/v1/statistics/vgs/students
  • Auth: Bearer JWT in header
  • Desktop version: (add your exact PBID version)
  • Privacy level: Organizational (tried others as well)
  • Endpoint returns a JSON object with fields like: data (list), total_records, page, page_size, and a boolean cached.
    In Power BI I frequently see cached = TRUE in the parsed JSON.

Symptoms

  • In my existing PBIX, after refresh I still get years 2018 and 2019.
  • The same M query in a fresh new PBIX returns correct data (no 2018/2019).
  • Postman also returns correct data (no 2018/2019).
  • The API response preview inside Power Query shows cached = TRUE when the old years appear.

Minimal M (sanitized)

let

    BaseUrl = "http://thestaff.co.in:8000",

    Path = "api/v1/statistics/vgs/students",

    Source = Web.Contents(

        BaseUrl,

        [

            RelativePath = Path,

            Query = [

                page = "1",

                page_size = "-1",

                sort_order = "asc"

            ],

            Headers = [

                Accept = "application/json",

                Authorization = "Bearer " & pToken   // pToken is a text parameter (JWT only)

            ]

        ]

    ),

    Json = Json.Document(Source)

in

    Json

What I’ve already tried (no change):

  1. Cleared Data Source Settings for the domain (Global & Current File) and re-authenticated as Anonymous.
  2. Cleared Power BI cache (File → Options → Data Load → Clear cache) and disabled background previews.
  3. Closed/reopened PBID and refreshed.
  4. Verified there are no duplicate/staging tables being loaded; checked Query Dependencies to ensure nothing is appending/merging old sources.
  5. Temporarily inactivated relationships and tested visuals that use only the API table.
  6. Confirmed no Incremental Refresh partitions or calculated snapshot tables.
  7. Added cache-busting:
    • Headers:
    • #"Cache-Control" = "no-cache, no-store",
    • Pragma = "no-cache"
    • Query param: _ts = DateTime.ToText(DateTimeZone.UtcNow, "yyyyMMddHHmmss")
      Still seeing cached = TRUE in the JSON in the old PBIX.
  8. Replaced the query by creating a new one with the working M (from the fresh PBIX), then renamed/swap-in. The issue sometimes persists until I fully rebuild the PBIX.

Observations

  • When the issue occurs, the JSON root I see in Power Query includes cached = TRUE.
  • Postman, using identical params/headers, returns the expected dataset (no 2018/2019).
  • A brand-new PBIX with the same M also returns the correct dataset.

Questions for experts

  1. Is there any Power Query/Power BI Desktop caching layer (beyond the standard cache I already cleared) that could cause a persisted, request-level cache for Web.Contents?
  2. Are there known behaviors where request keying for Web.Contents could reuse a cached response even with different Query params/headers?
  3. Any recommended way to force a cache miss from Power BI (e.g., special options, Binary.Buffer placement, or using Web.Contents’s Query vs RelativePath nuances) to guarantee a fresh call?
  4. Could Privacy levels, Fast Combine, or Preview caching still interfere even after being cleared?
  5. Is there any diagnostic approach (Query Diagnostics / Fiddler) you recommend to confirm what HTTP request PBID actually sends and whether the server is truly serving a cached artifact?

Goal
Make Power BI always pull fresh data from the API (matching Postman and the fresh PBIX), or at least reliably bypass any server or PBID cache when needed.

Happy to share additional sanitized logs or a tiny PBIX if helpful. Thanks!

 

1 REPLY 1
parry2k
Super User
Super User

@rouzbehrasai Quick question, is it in PQ preview that you are seeing the cache data, or when you actually load the data in the model, it still shows the old data



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors