29. Practice Exercises and Final Assignment
29.5 Modules 9–10: Folder Combine and Parameters
- Combine three monthly bank statements (Jan, Feb, Mar) from a folder. Clean title rows, Opening/Closing Balance lines and amounts with commas in Transform Sample File.
- Filter out
~$temporary and hidden files. - Derive Month and Month No from Source.Name.
- Make Mar.xlsx use Withdrawal Amt./Deposit Amt. and an extra Value Date column. Fix it with
MissingField.IgnoreandMissingField.UseNull. - Convert a single Amount column with Dr/Cr into Debit, Credit and Net Amount.
- Add Apr.xlsx and refresh. What would you need for scheduled refresh in the Service? What changes with a SharePoint folder?
- Create
FolderPath,ServerName(list) andStartDateparameters and use them in M. - Create a list query of cities and use it as Suggested Values for a
SelectedCityparameter. - Export a .pbit template and open it to test the parameter prompts.
- Create
RangeStart/RangeEndand describe the incremental refresh policy you would set for 3 years of orders.
Practice files (fictional): folder_orders/Orders_2026_04.csv, folder_orders/Orders_2026_05.csv
Hints
- Test with a third file and a hidden temp file.
- Month from Source.Name: Text.Middle or split by _.
Solutions (checked on the practice files)
- Practice equivalent: the two order files combine to 8 rows, ₹2,100 (April 3 rows ₹900, May 5 rows ₹1,200).
- Filter Extension = .csv and Attributes[Hidden] = false before Combine.
- From
Orders_2026_04.csv: Month No 4, Month April (FY 2026-27 month 1). - Use MissingField.Ignore / UseNull in Table.SelectColumns / Table.RenameColumns so a missing column does not break the query.
- Debit = if [Dr/Cr] = "Dr" then [Amount] else 0; Credit similarly; Net = Credit − Debit.
- Refresh picks up the new file. In the Service a local folder needs a gateway; a SharePoint folder needs no gateway.
- Use parameters in Source (FolderPath & file), server name and a date filter.
- Create a list query of cities and choose it as Suggested Values (Query) for SelectedCity.
- File › Export › Power BI template; opening the .pbit prompts for parameter values.
- Example policy: store 3 years, refresh last 10 days, on Order Date using RangeStart/RangeEnd (Module 10.8).
Ravindra Bagale's Tip
Friends, don't make a mistake here: a common mistake in the folder exercise is testing with only one or two files. Add a third file with a slightly different layout and a hidden temporary file, and make sure your query still works. This matters for both exams and interviews.
Ravindra Bagale's Tip – मराठी
मित्रांनो, इथे चूक करू नका: folder exercise मधली common चूक म्हणजे फक्त एक-दोन files वर test करणं. थोडा वेगळा layout असलेली तिसरी file आणि एक hidden temporary file जोडा, आणि तुमची query तरीही चालते याची खात्री करा. हे exam आणि interview दोन्हीसाठी important आहे.
Ravindra Bagale's Tip – हिंदी
दोस्तों, यहाँ गलती मत करना: folder exercise की common गलती है सिर्फ़ एक-दो files से test करना. थोड़े अलग layout वाली तीसरी file और एक hidden temporary file जोड़ो, और पक्का करो कि तुम्हारी query फिर भी चलती है. यह exam और interview दोनों के लिए ज़रूरी है.