<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Excel on Hat Full of Data</title><link>https://hatfullofdata.blog/categories/excel/</link><description>Recent content in Excel on Hat Full of Data</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><lastBuildDate>Fri, 14 Feb 2025 11:30:20 +0000</lastBuildDate><atom:link href="https://hatfullofdata.blog/categories/excel/index.xml" rel="self" type="application/rss+xml"/><item><title>Power Query – Creating New Parameters</title><link>https://hatfullofdata.blog/power-query-creating-new-parameters/</link><pubDate>Mon, 06 Jan 2025 11:52:37 +0000</pubDate><guid>https://hatfullofdata.blog/power-query-creating-new-parameters/</guid><description>&lt;img src="https://hatfullofdata.blog/power-query-creating-new-parameters/cover.png" alt="Featured image of post Power Query – Creating New Parameters" /&gt;&lt;p&gt;When fetching data into Power Query you need to use values to point you to the write the data, for example name of a database server or path to a csv file. Good practice is to use parameters for these values so your query is reusable etc. And its always our intention to go and create the new parameter later.&lt;/p&gt;
&lt;h2 id="missing-new-parameter-option"&gt;Missing New Parameter Option
&lt;/h2&gt;&lt;p&gt;So lets take the simplest option of connecting to a csv file on the web. I have my path so I click get data and select Web. For those that want to play along here is the path to the file I’m using.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://raw.githubusercontent.com/HatFullOfData/Demo/refs/heads/main/Products.csv
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The dialog that appears has a box for the URL but is missing the drop down on the left that will allow me to select New Parameter. If I had already created a parameter it gives me the option but not if I have no parameters. Bizarre functionality.&lt;/p&gt;
&lt;p&gt;&lt;img alt="From Web dialog with a text box for the URL but no dropdown to select New Parameter" class="gallery-image" data-flex-basis="745px" data-flex-grow="310" height="219" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-creating-new-parameters/2024-12-31_17-58-42.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="always-allow-parameters"&gt;Always Allow Parameters
&lt;/h2&gt;&lt;p&gt;The fix for this is to allow parameterization in data source dialogs. This can be done in the Power BI desktop options or on Power Query View ribbon for Power BI and Excel.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Power BI options dialog with Power Query Editor selected and Parameters highlighted. And the View ribbon in Power Query with the Parameters group highlighted" class="gallery-image" data-flex-basis="370px" data-flex-grow="154" height="440" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-creating-new-parameters/2024-12-31_18-09-27.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Once this is ticked when you now go to Get Data we get a drop down next to the text box. Now we can select New Parameter and enter in the details of the new parameter. When we click OK it returns to the first dialog with the new parameter selected.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Showing how to create a new parameter by clicking the drop down" class="gallery-image" data-flex-basis="632px" data-flex-grow="263" height="258" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-creating-new-parameters/2024-12-31_18-16-00.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;As a side note I recommend that you always give parameters a Type rather than leaving it on Any. There are a few features such as Power BI deployment pipelines that will not work with parameters of type Any.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;This is a really small feature, possibly doesn’t need a whole blog post. But that little drop down making the creating a new parameter that few clicks easier means I am more likely to follow my own advice and use parameters from the start.&lt;/p&gt;</description></item><item><title>Editing Azure DevOps items in Excel</title><link>https://hatfullofdata.blog/editing-azure-devops-items-in-excel/</link><pubDate>Tue, 20 Aug 2024 08:30:38 +0000</pubDate><guid>https://hatfullofdata.blog/editing-azure-devops-items-in-excel/</guid><description>&lt;img src="https://hatfullofdata.blog/editing-azure-devops-items-in-excel/cover.png" alt="Featured image of post Editing Azure DevOps items in Excel" /&gt;&lt;p&gt;One of the easiest ways to edit a project in Azure DevOps is to connect Excel to the project. This post walks you through connecting to a project and updating the DevOps items in Excel. Its mostly for selfish reasons as I need to remember how to do this.&lt;/p&gt;
&lt;p&gt;Microsoft also has a post about this at &lt;a class="link" href="https://learn.microsoft.com/en-us/azure/devops/boards/backlogs/office/bulk-add-modify-work-items-excel?wt.mc_id=DX-MVP-5003563" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/azure/devops/boards/backlogs/office/bulk-add-modify-work-items-excel&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="add-excel-extension"&gt;Add Excel Extension
&lt;/h2&gt;&lt;p&gt;This needs an Excel extension added from the Visual Studio site. You need to download Azure DevOps Office Integration 2019 from here and execute&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://visualstudio.microsoft.com/downloads/#azure-devops-office-integration-2019" target="_blank" rel="noopener"
 &gt;Download Visual Studio Tools – Install Free for Windows, Mac, Linux (microsoft.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grab from the link showing the item to download, Azure DevOps Office Integration 2019" class="gallery-image" data-flex-basis="1569px" data-flex-grow="653" height="104" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/editing-azure-devops-items-in-excel/2024-08-14_15-17-51.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Once you have done this, in Excel you will have a Team ribbon.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Team ribbon in Excel" class="gallery-image" data-flex-basis="1316px" data-flex-grow="548" height="124" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/editing-azure-devops-items-in-excel/2024-08-19_10-50-09.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="create-a-tree-query"&gt;Create a Tree Query
&lt;/h2&gt;&lt;p&gt;If you want to edit many items including child and parent hierarchy, then the easiest way is to write a tree query in DevOps that loads the right tasks and then use that to pull the right tasks into Excel. In DevOps under Boards select Queries. Then select New Query. Change query type to Tree of work items and type of tree to Parent/Child. Select the right filters to pull the items you want and then save your query. Save and run the query to make sure you get a hierarchy of tasks. In my example I wanted all the items in the project.&lt;/p&gt;
&lt;p&gt;&lt;img alt="creating a tree query in DevOps" class="gallery-image" data-flex-basis="319px" data-flex-grow="133" height="511" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/editing-azure-devops-items-in-excel/2024-08-19_11-39-24.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="connect-to-a-devops-project"&gt;Connect to a DevOps Project
&lt;/h2&gt;&lt;p&gt;On the Team ribbon, click on New List. If this is the first time you’ve connected you need to add a server first.&lt;/p&gt;
&lt;h3 id="adding-a-server"&gt;Adding a Server
&lt;/h3&gt;&lt;p&gt;Click on the Servers button. Then in the next dialog, click on Add. Into the next dialog enter in the url to the organisation, for example &lt;a class="link" href="https://dev.azure.com/HatFullOfData/" target="_blank" rel="noopener"
 &gt;https://dev.azure.com/HatFullOfData/&lt;/a&gt;. Click OK to finish adding the server, you will be prompted to login. Click Close to return to the original dialog.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen shots of the dialogs to add a server and finally the Connect window showing the Team Projects on the server." class="gallery-image" data-flex-basis="394px" data-flex-grow="164" height="414" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/editing-azure-devops-items-in-excel/2024-08-19_10-53-07.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="connecting-to-a-project"&gt;Connecting to a project
&lt;/h3&gt;&lt;p&gt;You start from the connect to Azure DevOps dialog, which will open from adding a server or opened by clicking on New List on the Team ribbon on a new sheet. Select the server and select the right project and click connect. Select your tree query from the drop down and click OK The tasks from the project should load as a table into Excel.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The two dialogs described in the text and the table of DevOps items in Excel" class="gallery-image" data-flex-basis="383px" data-flex-grow="159" height="426" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/editing-azure-devops-items-in-excel/2024-08-19_14-57-18.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The table format needs some explaining. Title 1 is the name of the highest level tasks and Title 2 etc are children of the Title 1 task above it. You can add another level of hierarchy by clicking on Add Tree Level from the Team ribbon. You can also add other DevOps columns by clicking Choose Columns and using the middle buttons to add or remove columns in the Choose columns dialog.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Team ribbon with Choose Columns and Add Tree Level highlighted and the Choose columns dialog." class="gallery-image" data-flex-basis="274px" data-flex-grow="114" height="595" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/editing-azure-devops-items-in-excel/2024-08-19_15-15-34-1.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="adding-and-publishing-devops-items-in-excel"&gt;Adding and Publishing DevOps items in Excel
&lt;/h2&gt;&lt;p&gt;Items can be added to the table just typing in new rows. The ID column leave blank, the Title 1 – 4 fill in making sure you understand the hierarchy. Some fields such as Target Date are read only for some Work Item Types. When you want to see the results in DevOps click on Publish. Then open DevOps to see the work items.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grab of the DevOps items in Excel and then the items in DevOps" class="gallery-image" data-flex-basis="374px" data-flex-grow="155" height="436" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/editing-azure-devops-items-in-excel/2024-08-19_15-50-22.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;I needed to create a project plan in DevOps from a list of tasks I had in a text file ready for a demo. There were 80 tasks and I knew I could it them quicker in Excel than I could in DevOps because I am more familiar with Excel. I also wanted to note down how I then loaded those tasks into DevOps from Excel.&lt;/p&gt;
&lt;p&gt;Other related series include:&lt;/p&gt;
&lt;h2 id="devops-with-power-automate-posts"&gt;DevOps with Power Automate posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Connecting Power Automate to Azure DevOps&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/" target="_blank" rel="noopener"
 &gt;Updating Start and Due dates and other fields&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/" target="_blank" rel="noopener"
 &gt;Using DevOps Rest API&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/" target="_blank" rel="noopener"
 &gt;Running a WIQL query&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/update-devops-without-notifications-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating items without Notifications&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-updates-on-behalf-of-another-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating a task on behalf of another person&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Export Data from Power BI Visuals</title><link>https://hatfullofdata.blog/export-data-from-power-bi-visuals/</link><pubDate>Sun, 05 Mar 2023 22:52:49 +0000</pubDate><guid>https://hatfullofdata.blog/export-data-from-power-bi-visuals/</guid><description>&lt;img src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/cover.jpg" alt="Featured image of post Export Data from Power BI Visuals" /&gt;&lt;p&gt;Excel has been the backbone of finance departments for decades. Almost every company has multiple spreadsheets that are business critical. Many Power BI adoption programmes have aimed to reduce the reliance on such spreadsheets. But we may still need to export data from Power BI into an Excel spreadsheet as old habits die hard and Excel is an amazing tool and Power BI will never replace it completely. This is one possible option and I will cover creating pivot tables from a dataset in another post.&lt;/p&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;&lt;a class="link" href="https://www.youtube.com/watch?v=ELPODdLH1Rc" target="_blank" rel="noopener"
 &gt;&lt;img alt="YouTube thumbnail" class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="383" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/Export-data-from-Power-BI-Visual-Time-0_00_0000.png" width="680"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="export-data-from-a-visual"&gt;Export data from a visual
&lt;/h2&gt;&lt;p&gt;&lt;img alt="On a visual selecting Export data" class="gallery-image" data-flex-basis="896px" data-flex-grow="373" height="182" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/Export_000.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;When viewing a report in the Power BI Service, the viewer can click on the three dots usually in the top right of the visual. When the menu that appears, they can click Export data. (See &lt;a class="link" href="#Admin" &gt;Admin&lt;/a&gt; and &lt;a class="link" href="#ReportSetting" &gt;Report Settings&lt;/a&gt; sections if its not there) Then it will display a dialog giving potentially multiple ways to export data.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Export data dialog showing 3 options, data with current layout, summarize data and underlying data. With Export and Cancel buttons in the bottom right corner." class="gallery-image" data-flex-basis="283px" data-flex-grow="118" height="576" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/Export_001.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Different options will be available based on the visual selected and the report options. The details for each option will be covered.&lt;/p&gt;
&lt;h3 id="data-with-current-layout"&gt;Data with current layout
&lt;/h3&gt;&lt;p&gt;&lt;img alt="Screen grab from Excel showing data in the same layout as the table in the report." class="gallery-image" data-flex-basis="407px" data-flex-grow="169" height="323" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/Export_002.jpg" width="549"&gt;&lt;/p&gt;
&lt;p&gt;This option is only available on Table or Matrix visuals. It creates an Excel file with almost exactly the same layout. The file is a pure export and does not include a refresh.&lt;/p&gt;
&lt;h3 id="summarized-data"&gt;Summarized Data
&lt;/h3&gt;&lt;p&gt;&lt;img alt="Screenshot from Excel showing all columns of data used to build the visual in a table layout" class="gallery-image" data-flex-basis="462px" data-flex-grow="192" height="353" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/Export_003.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Assuming the admin and report creator have allowed export, this option is available for most visuals. When selected it has three possibilities. The live connection is only available if you have contributor or higher access, i.e. its not available if you have Viewer access.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Excel with live connection, 500,000 row max.Live connection means the data can be refreshed at a future time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Excel, 150,000 row maxExport without refresh.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CSV file, 30,000 row maxCSV cannot include a refresh.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="underlying-data"&gt;Underlying Data
&lt;/h3&gt;&lt;p&gt;&lt;img alt="Screenshot of an Excel showing all the " class="gallery-image" data-flex-basis="514px" data-flex-grow="214" height="317" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/Export_004.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;This option is only available if the report creator has enabled it. (See Report Setting Options below) It exposes more columns than summarized. In this example it exports all the columns from the fact table, the 2 columns from the dimension table used and the measure used.&lt;/p&gt;
&lt;h2 id="applied-filters-in-export-data"&gt;Applied Filters in Export Data
&lt;/h2&gt;&lt;p&gt;When the data is exported, the exported data will be filtered with the report filters applied. Then the filter details are included in Excel files. CSV files will be filtered but will not include the details.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screenshot from Excel showing the applied filter to the export data" class="gallery-image" data-flex-basis="688px" data-flex-grow="286" height="237" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/Export_005.jpg" width="680"&gt;&lt;/p&gt;
&lt;h2 id="report-setting-options"&gt;Report Setting Options
&lt;/h2&gt;&lt;p&gt;A report creator can control if report readers can export data from the report. These settings are found under File – Options, CURRENT REPORT – Report settings. Then look under Export data. The first option is the default and will allow Data with Current Layout and Summarized data. When option 2 is selected, underlying data export is enabled as well. Option 3 disables all exports from this report.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Report settings dialog for Export Data" class="gallery-image" data-flex-basis="248px" data-flex-grow="103" height="656" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/Export_006.jpg" width="680"&gt;&lt;/p&gt;
&lt;h2 id="admin-options"&gt;Admin Options
&lt;/h2&gt;&lt;p&gt;&lt;img alt="Admin options for Export Data" class="gallery-image" data-flex-basis="340px" data-flex-grow="141" height="480" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/export-data-from-power-bi-visuals/Export_007.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Power Admins have ultimate control over this feature. There are 3 features they can restrict, enable or disable. These options are Export to Excel, Export to csv and Users can work with Power BI datasets. Disabling the third option will disable files having a live refresh.&lt;/p&gt;
&lt;p&gt;Also by using security groups, you can restrict any of these features to limited users across the tenancy.&lt;/p&gt;
&lt;h2 id="data-export-conclusion"&gt;Data Export Conclusion
&lt;/h2&gt;&lt;p&gt;Educating users in good practice on using these features will help your strong Excel users feel more comfortable. I can understand companies restricting parts of this, but I would hope it is not just a blanket ban hoping this will speed up adoption of Power BI. In my experience it will just make some people more stubborn. Stubborn workarounds will be shadow IT and increase your technical debt.&lt;/p&gt;
&lt;h2 id="resources"&gt;Resources
&lt;/h2&gt;&lt;p&gt;The UK Weather pbix file is on my github site – &lt;a class="link" href="https://github.com/Laura-GB/DemoData#video-and-blog-resources" target="_blank" rel="noopener"
 &gt;https://github.com/Laura-GB/DemoData#video-and-blog-resources&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="more-power-bi-posts"&gt;More Power BI Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-conditional-formatting-update/" target="_blank" rel="noopener"
 &gt;Conditional Formatting Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-data-refresh-date/" target="_blank" rel="noopener"
 &gt;Data Refresh Date&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-inactive-relationships-in-a-measure/" target="_blank" rel="noopener"
 &gt;Using Inactive Relationships in a Measure&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dax-crossfilter-function/" target="_blank" rel="noopener"
 &gt;DAX CrossFilter Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-coalesce-function-to-remove-blanks/" target="_blank" rel="noopener"
 &gt;COALESCE Function to Remove Blanks&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-personalize-visuals/" target="_blank" rel="noopener"
 &gt;Personalize Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-gradient-legends/" target="_blank" rel="noopener"
 &gt;Gradient Legends&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-endorse-a-dataset/" target="_blank" rel="noopener"
 &gt;Endorse a Dataset as Promoted or Certified&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-qa-synonyms-update/" target="_blank" rel="noopener"
 &gt;Q&amp;amp;A Synonyms Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-import-text-using-examples/" target="_blank" rel="noopener"
 &gt;Import Text Using Examples&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/paginated-report-resources/" target="_blank" rel="noopener"
 &gt;Paginated Report Resources&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/charticulator-simple-custom-chart/" target="_blank" rel="noopener"
 &gt;Charticulator&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-connector-july-2022-update/" target="_blank" rel="noopener"
 &gt;Dataverse Connector – July 2022 Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-choices-and-choice-column/" target="_blank" rel="noopener"
 &gt;Dataverse Choice Columns&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-switch-dataverse-tenancy/" target="_blank" rel="noopener"
 &gt;Switch Dataverse Tenancy&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-google-analytics/" target="_blank" rel="noopener"
 &gt;Connecting to Google Analytics&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-take-over-a-dataset/" target="_blank" rel="noopener"
 &gt;Take Over a Dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/export-data-from-power-bi-visuals/" target="_blank" rel="noopener"
 &gt;Export Data from Power BI Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-embed-a-paginated-report/" target="_blank" rel="noopener"
 &gt;Embed a Paginated Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-sql-on-dataverse-for-power-bi/" target="_blank" rel="noopener"
 &gt;Using SQL on Dataverse for Power BI&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-platform-solution-and-power-bi-part-1/" target="_blank" rel="noopener"
 &gt;Power Platform Solution and Power BI Series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-creating-a-custom-smart-narrative/" target="_blank" rel="noopener"
 &gt;Creating a Custom Smart Narrative&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="power-bi-series"&gt;Power BI Series
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;SVG in Power BI series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-project-online/" target="_blank" rel="noopener"
 &gt;Power BI and Project Online series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-slicers-introduction/" target="_blank" rel="noopener"
 &gt;Slicers series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-create-a-dataflow/" target="_blank" rel="noopener"
 &gt;Dataflow series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;Power BI SVG series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-data-into-power-bi/" target="_blank" rel="noopener"
 &gt;Power BI and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Query – VBA to Edit a Parameter Value</title><link>https://hatfullofdata.blog/excel-power-query-vba-to-edit-a-parameter-value/</link><pubDate>Wed, 21 Apr 2021 17:04:16 +0000</pubDate><guid>https://hatfullofdata.blog/excel-power-query-vba-to-edit-a-parameter-value/</guid><description>&lt;img src="https://hatfullofdata.blog/excel-power-query-vba-to-edit-a-parameter-value/cover.png" alt="Featured image of post Power Query – VBA to Edit a Parameter Value" /&gt;&lt;p&gt;This post is to document how to use Excel VBA to edit a parameter value without using the a cell reference in Power Query. My query was using Web.Contents which works with parameters in Excel Power Query1 but doesn’t like a function as part of the path.&lt;/p&gt;
&lt;p&gt;I started with Chris Webb’s great post on using an Excel named range and Web.Contents gave me problems. I would try Chris Webb’s method first which is found here &lt;a class="link" href="https://blog.crossjoin.co.uk/2014/07/22/working-with-excel-named-ranges-in-power-query/" target="_blank" rel="noopener"
 &gt;https://blog.crossjoin.co.uk/2014/07/22/working-with-excel-named-ranges-in-power-query/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So I want a button to take the value from a cell and update the value in a parameter. I searched the web and found one solution buried in a MrExcel forum so I’m documenting the solution here mostly so I can find it again later.&lt;/p&gt;
&lt;h3 id="vba-code-to-edit-a-parameter-value"&gt;VBA Code to Edit a Parameter Value
&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Sub ChangeParameterValue(ParameterName As String, ParameterValue As String)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Dim qry As WorkbookQuery
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Dim formula As Variant
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;=== Get the query
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Set qry = ThisWorkbook.Queries(ParameterName)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;=== Split the formula into 3 parts and update the second one
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; formula = Split(qry.formula, Chr(34), 3)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; formula(1) = ParameterValue
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;=== Update the parameter value
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; qry.formula = Join(formula, Chr(34))
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;End Sub
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="description"&gt;Description
&lt;/h3&gt;&lt;p&gt;The formula property of a query is really weird and hard to construct so the above function splits on Chr(34), which is a “. It then updates the middle value to the new value and then sticks the three values back together again.&lt;/p&gt;
&lt;p&gt;The original forum post I got the solution from can be found at &lt;a class="link" href="https://www.mrexcel.com/board/threads/vba-code-to-edit-power-query-data-source-settings.1146964/" target="_blank" rel="noopener"
 &gt;https://www.mrexcel.com/board/threads/vba-code-to-edit-power-query-data-source-settings.1146964/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Footnotes&lt;/p&gt;
&lt;p&gt;1 – Web.Contents varies in different versions of Power Query so test carefully and do not assume you can copy and paste queries.&lt;/p&gt;
&lt;h2 id="more-power-query-posts"&gt;More Power Query Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-handwritten-function/" target="_blank" rel="noopener"
 &gt;Custom Handwritten Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-multi-step-function/" target="_blank" rel="noopener"
 &gt;Multi-step Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-replace-values-for-whole-table/" target="_blank" rel="noopener"
 &gt;Replace Values for Whole Table&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-ai-insights-error/" target="_blank" rel="noopener"
 &gt;AI Insights Error&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/excel-power-query-vba-to-edit-a-parameter-value/" target="_blank" rel="noopener"
 &gt;VBA to Edit a Parameter Value&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-dynamic-data-source-and-web-content/" target="_blank" rel="noopener"
 &gt;Dynamic Data Source and Web.Contents()&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-get-previous-row-data/" target="_blank" rel="noopener"
 &gt;Get Previous Row Data&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-creating-new-parameters/" target="_blank" rel="noopener"
 &gt;Creating New Parameters&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-fixing-missing-columns-dynamically/" target="_blank" rel="noopener"
 &gt;Fixing Missing Columns Dynamically&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-handling-null-values/" target="_blank" rel="noopener"
 &gt;Handling Null Values Properly&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>