Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
In many financial dashboards and models, daily interest rates — especially Treasury Bill (T-Bill) rates — are critical data points.
Traditionally, this information is either:
Manually downloaded,
Updated periodically via spreadsheets, or
Hardcoded into static tables.
👉 However, manually maintaining this data introduces:
Risk of errors,
Time overhead,
Lack of real-time updates.
In a dynamic world, an automated solution is needed to fetch daily updated Treasury Bill rates directly inside Power BI — without needing to maintain tables manually.
I created a simple but powerful Power Query script that dynamically fetches current year T-Bill rates straight from the U.S. Treasury website and loads them into Power BI.
Here's the full code:
let
// Define base URL
BaseUrl = "https://home.treasury.gov/resource-center/data-chart-center/interest-rates/TextView",
// Dynamic part
CurrentYear = Date.Year(DateTime.LocalNow()),
QueryString = "?type=daily_treasury_bill_rates&field_tdr_date_value=" & Text.From(CurrentYear),
// Use Web.Contents with separate RelativePath
Source = Web.Page(Web.Contents(BaseUrl, [RelativePath = QueryString])),
// Continue as normal
Data = Source{0}[Data],
RenamedColumns = Table.RenameColumns(Data, {{"COUPON EQUIVALENT", "4 Week COUPON EQUIVALENT"}}),
SelectedColumns = Table.SelectColumns(RenamedColumns, {"Date", "4 WEEKS BANK DISCOUNT", "4 Week COUPON EQUIVALENT"}),
ChangedTypes = Table.TransformColumnTypes(SelectedColumns, {
{"Date", type date},
{"4 Week COUPON EQUIVALENT", type number},
{"4 WEEKS BANK DISCOUNT", type number}
}),
#"Changed Type" = Table.TransformColumnTypes(ChangedTypes,{{"4 Week COUPON EQUIVALENT", Percentage.Type}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [Date] > #date(2025, 3, 31))
in
#"Filtered Rows"
How It Works 🧠
Base URL points to the Treasury official website.
Current year is dynamically calculated using Date.Year(DateTime.LocalNow()), so no need to manually update the year every January!
Web.Contents + RelativePath cleanly pulls the targeted page.
Web.Page extracts the tabular data from the page.
Filtering ensures only future or recent dates are pulled, based on a threshold (#date(2025, 3, 31) here).
Renaming/Transforming makes the data clean, user-friendly, and ready for reporting.
Zero Maintenance
Once set up, Power BI refreshes Treasury rates automatically without manual intervention.
Always Updated
Data stays fresh and current, directly from the U.S. Treasury.
Dynamic Year Handling
No need to hardcode years — perfect for annual reporting without changes.
Time Saver
Saves significant manual effort, reducing chances of errors.
Professional Dashboards
Enables you to easily integrate daily rates into interest income models, investment dashboards, and treasury reporting systems.
This small but powerful automation removes manual dependency and ensures that Power BI models always operate with the latest financial rates.
A must-have feature for any financial analyst, investment professional, or corporate finance team using Power BI!
Feel free to adapt this solution based on your local regulations, treasury sources, or modify the filtering logic to fit your reporting cycles.
Happy Power Querying! 🚀
If you'd like a version that covers multiple years or builds a historical dataset, I’d be happy to share that in a future blog. Let me know in comments!
✅ Author: John Basha (johnbasha33) — Super User, Fabric Community
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
@Natalie_iTalent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.