exam questions

Exam DA-100 All Questions

View all questions & answers for the DA-100 exam

Exam DA-100 topic 1 question 20 discussion

Actual exam question from Microsoft's DA-100
Question #: 20
Topic #: 1
[All DA-100 Questions]

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You create a parameter named DataSourceExcel that holds the file name and location of a Microsoft Excel data source.
You need to update the query to reference the parameter instead of multiple hard-coded copies of the location within each query definition.
Solution: In the Power Query M code, you replace references to the Excel file with DataSourceExcel.
Does this meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
AzureRookie
Highly Voted 4 years, 4 months ago
I think it is yes. https://wkrzywiec.medium.com/passing-source-folder-path-as-parameter-to-query-code-in-power-query-19ec60797d94
upvoted 77 times
cufta05
3 years, 7 months ago
You are correct
upvoted 1 times
...
harshada009
3 years, 11 months ago
what is the correct answer?
upvoted 4 times
...
mirzotti
3 years, 5 months ago
On exam 21-12-2021. I answered NO.
upvoted 1 times
cortado
3 years, 4 months ago
Was your answer correct?
upvoted 5 times
Xavich
3 years ago
Nobody ever will know if their answer is correct, so I hate it when people think just because they answered the question, its correct. you'll always have to follow your own reasoning.
upvoted 10 times
RazaTheLegend
2 years, 1 month ago
If he said if he got 100 we could believe his answer at that time, but power bi changes and therefore the answer could be different too.
upvoted 1 times
...
...
...
...
puttybi
4 years, 4 months ago
I think it is B. The question states that you have created parameters already, so the solution in B would apply better even though your reference would work too.
upvoted 10 times
manlynn
4 years, 1 month ago
See the reference: https://sqlskull.com/2020/10/23/change-the-data-source-dynamically-in-power-bi-using-parameters/
upvoted 4 times
...
Iroshan
4 years, 1 month ago
Answer A: Yes. You can edit the M code very easily to add the parameter as the file name. Can be done.
upvoted 7 times
Iroshan
4 years, 1 month ago
https://community.powerbi.com/t5/Desktop/Passing-parameters-as-a-data-source-path-to-other-table/td-p/1047983
upvoted 4 times
...
...
eurekamike
3 years, 9 months ago
The question says we are replacing the hardcoded file references with the parameter. I don't believe you read the question correctly. Both options work, so either way it is still A.
upvoted 3 times
...
...
...
nemanjaandic
Highly Voted 4 years, 2 months ago
Correct answer should be B) If you have 10 queries, each of them pointing to the same Excel file on local drive. If you need to change Excel file location using M code, you need to go to advanced editor for each query and hard-code location of new Excel file. And you need to repeat it each time you change the data source. On the other hand, if you create just 1 parameter and use this parameter name instead of hard-code Excel location in each query, once you change parameter value (only on one place), it updates automatically all 10 queries. So you will have to change reference from hard-coded value to parameter on each query, but you do this only once, after that you change only parameter value on 1 place.
upvoted 28 times
manlynn
4 years, 1 month ago
But the question is asking if this action meets the goal, not if this is the best solution.
upvoted 19 times
...
federico_mgm
3 years, 7 months ago
But the solution proposes to USE the parameter. It says to add it in M code and not in the graphical interface, but the result should be the same, it does not say "hard-code location of new Excel file"
upvoted 2 times
...
Vulkany
3 years, 9 months ago
I agree with your opinion.
upvoted 1 times
...
nemanjaandic
4 years, 2 months ago
As there are 3 questions in this scenario, if only one should be correct then correct is the one where you change data source within step in power query. Here is the tricky part of this question: "Solution: In the Power Query M code, you replace references to the Excel file with DataSourceExcel." Power Query M code = singular ReferenceS = plural There should be only ONE reference to the file source within M code. And you can't change references of all queries within only one Power Query M code. You need to enter each one and edit it.
upvoted 3 times
...
...
CUE
Most Recent 2 years ago
Answer is B
upvoted 1 times
...
CreateSiteCollection
2 years, 11 months ago
The URL provided by the answer indicate the answer is Yes
upvoted 1 times
...
Bhushan_M
2 years, 12 months ago
Selected Answer: A
I think A Yes is the ans becuase in que we have been asked if it serves the purpose Yes it serves the purpose. If the question was it the efficient way to change in all queries the ans would be NO.
upvoted 2 times
...
dmnantilla9
3 years ago
The Correct answer is: A YES
upvoted 2 times
...
Aibloy
3 years ago
FALSE.Correct answer is B. You don't use M for change multiple sources (of course you can, but you don't have to). Best way is open "Configure data sources", select the actual path and change it by the parameter. All the querys that refeer to the Excel path will change to the parameter. Efficient way. Tricky question.
upvoted 5 times
Angell
2 years, 12 months ago
@Aibloy just tried what you stated and my man you're totally right. This what I did: I created multiple copies of a query on Power Query, then I changed the data source manually in the advance editor from path to the parameter. After applying changes I noticed It was just changed on the specific query I made the changes on. On the other hand , when I went to "Data Source Settings" on ribbon (home tab), chose the datasource and clicked on "Change source..." button, changed the path for the parameter. This changed all the copies' datasource to the parameter. So yes, correct answer for this question is B.
upvoted 1 times
...
...
simus90
3 years, 1 month ago
Selected Answer: A
A is correct
upvoted 1 times
...
simus90
3 years, 1 month ago
answer A i think
upvoted 1 times
...
Ashley090521
3 years, 2 months ago
on exam 3/1/2022
upvoted 1 times
...
Sudhansu21
3 years, 2 months ago
On Exam Feb, 2022
upvoted 1 times
...
teeman001
3 years, 3 months ago
Selected Answer: B
If you need to change Excel file location using M code, you need to go to advanced editor for each query and hard-code location of new Excel file
upvoted 1 times
...
phoebe01
3 years, 4 months ago
the description of answer supports A option
upvoted 1 times
...
phoebe01
3 years, 4 months ago
A is correct.
upvoted 1 times
...
Treffic
3 years, 4 months ago
you replace references to the excel file with DataSourceExcel in the Power Query M code, so it should be option A
upvoted 1 times
...
walkerzjs
3 years, 5 months ago
'Instead modify the source step of the queries to use DataSourceExcel as the file path.' & 'In the Power Query M code, you replace references to the Excel file with DataSourceExcel.' Why do I feel they are the same meaning, essentisally?
upvoted 1 times
...
PatrickStr
3 years, 5 months ago
on exam 12/10/2021
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago