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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PiyushH1
Helper I
Helper I

Error on Refresh

Hi Team ,

I am using below code on exchnage rate , but some how data is not refreshed in Power Bi service on shedule refreshment. but when i do refrresh in Power bi desktop , than it's refresh in desktop. 

Is their any way in power bi service patlform my can refresh on shedule refreshment ?

See below code.

 

Code 1 : 

let
Source = (Date as text) => let
Source = Json.Document(Web.Contents("https://api.exchangeratesapi.io" ,[RelativePath = "/" & Date & "?base=GBP"])),
rates = Source[rates],
#"Converted to Table" = Record.ToTable(rates),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Name", "Currency"}, {"Value", "Rate"}})
in
#"Renamed Columns"
in
Source

 

 

Code 2 :

let
Source = {Number.From(Date.AddDays(DateTime.Date(DateTime.LocalNow()),-Duration.Days(Date.From(DateTime.LocalNow())-#date(2015,1,1))))..Number.From(DateTime.Date(DateTime.LocalNow()))},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type2" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type date}}),
#"Changed Type" = Table.TransformColumnTypes(#"Changed Type2",{{"Column1", type date}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Date"}}),
#"Invoked Custom Function" = Table.AddColumn(#"Renamed Columns", "ExchangeRates", each Fn_GetHistoricExchangeRates (Date.ToText([Date],"yyyy-MM-dd"))),
#"Expanded ExchangeRates" = Table.ExpandTableColumn(#"Invoked Custom Function", "ExchangeRates", {"Currency", "Rate"}, {"Currency", "Rate"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded ExchangeRates",{{"Rate", type number}, {"Currency", type text}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type1", each ([Currency] = "EUR")),
#"Renamed Columns1" = Table.RenameColumns(#"Filtered Rows",{{"Currency", "GBP->EUR"}, {"Rate", "GBP/EUR"}})
in
#"Renamed Columns1"

 

 

 

 

Regards,

Piyush Hirpara

2 REPLIES 2
lbendlin
Super User
Super User

When a scheduled refresh fails you should see an error message in the dataset refresh history. What does it say?

Hi ,

 

error  is not coming , just data is not coming correclty 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Kudoed Authors