Gemini는 Power Query M을 작성하고 문제를 찾는 데 도움을 주지만 Excel의 환율을 가져오지는 않습니다. 실제 요청은 Web.Contents를 실행하는 Excel이 보냅니다. 이 가이드는 익명 최신 엔드포인트를 사용하고 응답을 검증하며 source, data_updated_at, market_session을 표시합니다.
Key points
Gemini는 M을 초안하고 설명하며 Excel Power Query가 HTTP 요청과 표 새로 고침을 수행합니다.
Web.Contents의 RelativePath와 Query를 사용해 취약한 URL 문자열 연결을 피합니다.
USD 기준 JPY, KRW, EUR을 요청하고 source와 관측 시각을 표시합니다.
익명 접근은 IP당 분당 12회, 시간당 100회입니다. 공유 통합 문서에 API 키를 넣지 마세요.
환율은 모델, 분석, 표시용 인디케이티브 값이며 결제 정산용이 아닙니다.
Gemini는 쿼리를 돕는 도구이지 데이터 소스가 아닙니다
Gemini는 자연어 요구사항을 Power Query M으로 바꾸고 단계를 설명하며 새로 고침 실패의 해결책을 제안할 수 있습니다. 그러나 통합 문서의 환율을 스스로 최신으로 만들지는 않습니다. API를 호출하고 JSON을 파싱하며 통화와 메타데이터를 확인하고 숫자 옆에 관측 정보를 남기는 쿼리가 필요합니다.
Gemini 프롬프트에는 공개 문서 URL과 필요한 응답 필드를 포함하세요. API 키, 비공개 통합 문서 데이터, 고객 정보를 붙여 넣지 마세요.
Prompt for Gemini
Gemini에게 매크로 없는 Excel Power Query M 쿼리를 작성해 달라고 요청하세요.
https://exchangerate.dev/docs/api-reference
와 익명 엔드포인트 /v1/latest/USD?symbols=JPY,KRW,EUR 를 사용합니다.
Web.Contents에서 RelativePath = "v1/latest/USD" 및
Query = [symbols = "JPY,KRW,EUR"] 를 사용하세요. JSON을 파싱하고
rates, sources, data_updated_at, market_session 필드가 있는지 검증한 뒤
Currency, Rate, Source, DataUpdatedAt, MarketSession 열을 반환하세요.
API 키나 추측한 대체값은 넣지 말고 HTTP 오류를 표시하세요.
Power Query 만들기
Excel에서 데이터 → 데이터 가져오기 → 기타 원본에서 → 빈 쿼리를 열고 고급 편집기를 선택합니다. 아래 쿼리로 바꾸세요. Web.Contents의 RelativePath와 Query는 Microsoft가 문서화한 옵션입니다(Microsoft 문서).
Power Query M · FXTracker
let
Response = Web.Contents(
"https://api.exchangerate.dev",
[
RelativePath = "v1/latest/USD",
Query = [symbols = "JPY,KRW,EUR"],
ManualStatusHandling = {429}
]
),
Status = try Value.Metadata(Response)[Response.Status] otherwise 200,
Checked = if Status <> 200 then
error "The FX endpoint returned HTTP " & Text.From(Status)
else Response,
Json = Json.Document(Checked),
Rates = try Json[rates] otherwise error "The response has no rates field",
Sources = try Json[sources] otherwise error "The response has no sources field",
UpdatedAt = try Json[data_updated_at] otherwise error "The response has no data_updated_at field",
Session = try Json[market_session] otherwise error "The response has no market_session field",
RequireRate = (rates as record, code as text) as number =>
let value = try Record.Field(rates, code) otherwise null
in if value is number and value > 0 then value else error (code & " is missing or invalid"),
RequireSource = (sources as record, code as text) as text =>
let value = try Record.Field(sources, code) otherwise null
in if value is text and Text.Length(value) > 0 then value else error (code & " source is missing or invalid"),
RequiredMetadata = if UpdatedAt is text and Text.Length(UpdatedAt) > 0 and Session is text and Text.Length(Session) > 0 then true else error "Required metadata is missing or invalid",
Rows = if RequiredMetadata then Table.FromRecords({
[Currency = "JPY", Rate = RequireRate(Rates, "JPY"), Source = RequireSource(Sources, "JPY"), DataUpdatedAt = UpdatedAt, MarketSession = Session],
[Currency = "KRW", Rate = RequireRate(Rates, "KRW"), Source = RequireSource(Sources, "KRW"), DataUpdatedAt = UpdatedAt, MarketSession = Session],
[Currency = "EUR", Rate = RequireRate(Rates, "EUR"), Source = RequireSource(Sources, "EUR"), DataUpdatedAt = UpdatedAt, MarketSession = Session]
}) else error "Required metadata is missing or invalid",
Typed = Table.TransformColumnTypes(Rows, {{"Currency", type text}, {"Rate", type number}, {"Source", type text}, {"DataUpdatedAt", type datetimezone}, {"MarketSession", type text}})
in
Typed
각 값을 설명하는 표로 불러오기
완료 → 닫기 및 다음으로 로드… → 표를 선택합니다. 성공하면 통화마다 한 행이 만들어집니다. 환율은 USD 1단위에 대한 인용 통화 단위입니다. Source, DataUpdatedAt, MarketSession은 관측을 설명할 뿐 체결 가능한 가격으로 바꾸지 않습니다.
Currency환율 및 메타데이터해석
JPYRate, Source, DataUpdatedAt, MarketSession관측값과 맥락을 한 행에 표시
KRWRate, Source, DataUpdatedAt, MarketSession관측값과 맥락을 한 행에 표시
EURRate, Source, DataUpdatedAt, MarketSession관측값과 맥락을 한 행에 표시
누락된 데이터를 0으로 바꾸지 마세요
통화, 메타데이터 또는 요청이 누락되면 쿼리를 오류로 중단하세요. 0은 실제 환율처럼 보여 모델을 조용히 손상시킬 수 있습니다.
추적기 새로 고침
데이터 → 모두 새로 고침을 사용하면 쿼리가 다시 실행됩니다. 예약 새로 고침과 Power Query 기능은 Excel 버전, 운영체제, 개인 정보 설정, 조직 정책에 따라 다릅니다. Mac과 Windows에 같은 자동 새로 고침 기능이 있다고 가정하지 말고 실제 사용 환경에서 테스트하세요.
표시된 오류 해결하기
오류의미조치
HTTP 429익명 IP별 한도에 도달했습니다.새로 고침 빈도와 통화쌍 수를 줄이거나 키가 있는 서버 프록시를 사용하세요.
HTTP 403요청이 거부되었으며 Excel의 기본 자격 증명 또는 액세스 처리가 원인일 수 있습니다.엔드포인트와 Excel 개인 정보 및 원본 설정을 확인하고 자격 증명 창이나 쿼리 오류를 살펴보세요. 공유 통합 문서에 키를 붙이지 마세요.
통화 또는 메타데이터 누락응답 형태가 쿼리 요구와 다릅니다.오류를 유지하고 M 코드를 바꾸기 전에 응답을 확인하세요.
새로 고침 후 새 값이 없음쿼리가 실행되지 않았거나 응답이 캐시되었습니다.쿼리 및 연결과 새로 고침 세부 정보를 확인하고 이전 관측값을 최신으로 표시하지 마세요.
한계 이해하기
이 매크로 없는 통합 문서는 개인용 추적기와 모델 입력에 유용합니다. 익명 접근은 IP당 분당 12회, 시간당 100회이며 공유 출구 때문에 실제 처리량이 달라질 수 있습니다. 공유 통합 문서에 예측 가능한 계정 단위 용량이 필요하면 키를 서버에 보관하세요. 키를 Power Query, 통합 문서 매개 변수, 프롬프트, 버전 관리에 넣지 마세요. 값은 인디케이티브이며 결제 정산용이 아닙니다.