# Tags
**Software** : [[02 - Tags/Software/Power Query]]
**Functions** used : [[Table.ToColumns]] [[List.Combine]] [[List.Distinct]] [[02 - Tags/Power Query Functions/List.Select]] [[Table.Transpose]] [[Table.PromoteHeaders]] [[Table.TransformColumnTypes]] [[Excel.CurrentWorkbook]]
**Date** : 16-March-2025
# Description
- In this video I show you some tricks using list functions to identify Frequently or non Frequently used values in a dataset. I'll be using Stock Codes in various portfolio - so you can see how many times some stocks appear in a list of portfolios.
# Video Link
<iframe width="560" height="315" src="https://www.youtube.com/embed/KmG88fSpHWs?si=IwlCPJI5odnigfgT" 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_VALUE_ALL_COLUMNS_VIDEO.xlsx)
# M-Query
```Query 1
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
ColConvert = Table.ToColumns(Source),
ListCombined = List.Combine(ColConvert),
Result = List.Distinct(
List.Select(ListCombined,
(MainList)=>
List.Count(List.Select(ListCombined, (SubList)=> MainList = SubList))=paramcount[Stock Freq]{0}))
in
Result
```
```Query 2 - Parameter
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
Custom1 = Table.Transpose(Source),
#"Promoted Headers" = Table.PromoteHeaders(Custom1, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Stock Freq", Int64.Type}})
in
#"Changed Type"
```
## Optional Tags
**Tags** :
**Technique** : [[Inner Outer Tables]] [[Input Parameter]]