This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I am trying to retrieve detail records for every six-digit ID of a list. I have a parameter that is fed this list:
I want the parameter to pass the correct value when its function (API call) is invoked for each row of a table (which should be based on the matching row ID of the table) to pull those detail records:
However, it only ever passes the "Current Value" to every row instead of the correct value (the matching one from the CampaignID column). If I uncheck the "Required" box and leave Current Value blank, I get an error about not being able to convert null into text. How can I get around the Current Value requirement so that it dynamically picks the appropriate value based on the row and retrieves the detail records for that row? What is the correct solution here?
Edit: For further context, here is the function I am invoking in the custom column:
() => let
Source = Xml.Tables(Web.Contents(https://webapi.urlexample.com/webapi/v01.0/eobjects/XMLData/ & "CampaignOpenClickDetails/" & Number.ToText(CampaignIdParameter) & "?pageon=1&pagesize=500", [Headers=[#" UserKey”=”key”,#" Company"="company", #"UserName"="user"]])),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ErrorCount", Int64.Type}, {"SuccessCount", Int64.Type}, {"TotalQueryCount", Int64.Type}}),
ResultMessages = #"Changed Type"{0}[ResultMessages],
Campaign = ResultMessages{0}[Campaign],
Recipients = Campaign{0}[Recipients],
MailingList = Recipients{0}[MailingList],
MailingListSubscriber = MailingList{0}[MailingListSubscriber]
in
MailingListSubscriber
Solved! Go to Solution.
Do you need to create a parameter for this? I'm not at my desk, but can't you just replace
& Number.ToText(CampaignIDParameter)
with
& each Number.ToText([CampaignID])
--Nate
@Anonymous is correct. You should pass the ID value from the row, not a single parameter value.
A parameter is designed to be constant throughout the query. It's not a variable that gets updated for each row.
Do you need to create a parameter for this? I'm not at my desk, but can't you just replace
& Number.ToText(CampaignIDParameter)
with
& each Number.ToText([CampaignID])
--Nate
Hello @Anonymous and @AlexisOlson ,
Thanks very much for your replies. For some reason I thought a parameter was necessary here but I'm glad to be corrected.
I tried replacing the parameter call in this function with the value ID from the row as Nate suggested but was hit with
Expression.SyntaxError: Token Literal Expectedat the "each" keyword, so I wrapped it in parenthesis:
() => let
Source = Xml.Tables(Web.Contents("https://webapi.urlexample.com/webapi/v01.0/eobjects/XMLData/" & "CampaignOpenClickDetails/" & (each Number.ToText([CampaignId]) & "?pageon=1....and was then hit with
An error occurred in the 'Campaign Data function' query. Expression.Error: We cannot apply operator & to types Text and Function.
Details:
Operator-&
Left=https://webapi.urlexample.com/webapi/v0.1.0/eobjects/XMLData/CampaignOpenClickDetails/
Right=[Function]I'm sure there is some silly syntactical mistake I'm overlooking here but I'm not well-versed enough in M to recognize it.
I figured it out. I was trying to add & each Number.ToText([CampaignID]) to the function when really I needed to scrap the function altogether and just put it into the custom column query itself. Also, Power BI didn't like me using Number.ToText but when I changed the CampaignID column data type to Text pre-emptively and THEN referenced those values in the custom column, it worked. Thank you @Anonymous and @AlexisOlson for sending me down the right path!
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 4 | |
| 3 | |
| 3 |