This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
In my query editor, I have these columns. The column names differ, but the values are all the same:
I'm trying to find a way to get the counts of the values without unpivoting. I've already unpivoted this data before which makes everything easy to count, but it does not allow me to calculate averages over time and things of that nature correctly once it is unpivoted. How else could I get a count of each value?
Solved! Go to Solution.
HI @Anonymous,
You can refer to below formula to transform table as group result.
Power query custom function:
let
Groupping= (source as table) =>
let
Source= Text.Split(Text.Combine(Table.ToList(source),","),","),
Transformed=Table.FromList(List.Distinct(Source),Splitter.SplitByNothing(),{"Item"}),
Output = Table.AddColumn(Transformed,"Count", each Function.Invoke((x)=> List.Count(List.Select(Source, each _ = x)),{_[Item]}))
in
Output
in
Groupping
Notice: my function not works for value with date format, please convert date type as text before invoke.
Regards,
Xiaoxin Sheng
HI @Anonymous,
You can refer to below formula to transform table as group result.
Power query custom function:
let
Groupping= (source as table) =>
let
Source= Text.Split(Text.Combine(Table.ToList(source),","),","),
Transformed=Table.FromList(List.Distinct(Source),Splitter.SplitByNothing(),{"Item"}),
Output = Table.AddColumn(Transformed,"Count", each Function.Invoke((x)=> List.Count(List.Select(Source, each _ = x)),{_[Item]}))
in
Output
in
Groupping
Notice: my function not works for value with date format, please convert date type as text before invoke.
Regards,
Xiaoxin Sheng
@Anonymous thank you! This is a bit over my head but I will give it a try.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 28 | |
| 23 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 49 | |
| 47 | |
| 40 | |
| 21 | |
| 18 |