# Tags
**Software** : [[02 - Tags/Software/Power Query]]
**Functions** used : [[Excel.CurrentWorkbook]] [[Table.TransformColumnTypes]] [[Record.ToTable]] [[Sections Sharp]] [[Table.SelectRows]] [[Table.ExpandTableColumn]]
**Date** : 09-April-2025
# Description
This totally blew my mind! you can reference your won queries like you do with any other query using the [#sections](https://www.youtube.com/hashtag/sections) function. In this tutorial I dynamically append queries using this function instead of the conventional append method.
# Video Link
<iframe width="560" height="315" src="https://www.youtube.com/embed/0zuwV20ORvg?si=hQ33JXgr05yerv6L" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
[GITHUB File Link](https://github.com/jbotes/powerbiTutorials/blob/main/Pq_Query_Referencing_Video.xlsx)
# M-Query
```mquery
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"History", type text}, {"Stock", type text}, {"% ofPortfolio", type text}, {"RecentActivity", type text}, {"Shares", Int64.Type}, {"ReportedPrice*", type text}, {"Value", type text}, {"Unnamed: 7", type any}, {"CurrentPrice", type text}, {"+/-ReportedPrice", type text}, {"52WeekLow", type text}, {"52WeekHigh", type text}, {"PortfolioName", type text}, {"PortfolioDate", type datetime}, {"URL", type text}})
in
#"Changed Type"
```
```mquery
let
Source = Record.ToTable(#sections[Section1]),
#"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Name], "holding", Comparer.OrdinalIgnoreCase)),
#"Expanded Value" = Table.ExpandTableColumn(#"Filtered Rows", "Value", {"Column1", "History", "Stock", "% ofPortfolio", "RecentActivity", "Shares", "ReportedPrice*", "Value", "Unnamed: 7", "CurrentPrice", "+/-ReportedPrice", "52WeekLow", "52WeekHigh", "PortfolioName", "PortfolioDate", "URL"}, {"Column1", "History", "Stock", "% ofPortfolio", "RecentActivity", "Shares", "ReportedPrice*", "Value.1", "Unnamed: 7", "CurrentPrice", "+/-ReportedPrice", "52WeekLow", "52WeekHigh", "PortfolioName", "PortfolioDate", "URL"})
in
#"Expanded Value"
```
## Optional Tags
**Tags** :
**Technique** : [[Records to Decompose Problem]] [[Meta Data about PowerQuery]]