- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

How to force a line to execute in Power Query
I recently posted this question when my query would not refresh correctly. The query would only refresh correctly after I refreshed the preview.
To summarise the question and answer, the reason why the query would only refresh correctly after refreshing the preview was because one of the steps in the query was not referenced by the final step, but was essential for the API to work correctly (please see post for full details).
My question is simple: how do I force Power Query to execute a step even if that step is not referenced in the final step? To illustrate my point, how would I force Power Query to execute step "a = "123"," below?
let
a = "123",
b = "456"
in
b
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,
May be,
let
a = "123",
b = "456",
Choose = (chooseFirst as logical, first, second) =>
if chooseFirst then first else second
in
Choose(false, a, b)
https://bengribaudo.com/blog/2018/02/28/4391/power-query-m-primer-part5-paradigm
Stéphane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,
May be,
let
a = "123",
b = "456",
Choose = (chooseFirst as logical, first, second) =>
if chooseFirst then first else second
in
Choose(false, a, b)
https://bengribaudo.com/blog/2018/02/28/4391/power-query-m-primer-part5-paradigm
Stéphane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

This seems a bit convoluted? Am I missing something? I would do:
let
a = "123",
b = "456"
in
if a <> null then b else b

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
06-20-2024 09:37 PM | |||
08-03-2023 03:08 PM | |||
09-10-2024 07:35 AM | |||
03-25-2023 11:55 AM | |||
08-29-2024 03:34 AM |