Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I'm trying to evaluate all columns in one big table (99 columns, 1.5m rows).
What i need get is the list of all columns and the count of how many records are there in the respective column.
Table has various column types: dates, strings, numbers, boolean values.
What is the best approach to do this?
What i've tried so far are List functions, but it either seems too long for the refresh (over an hour and a half).
My first step was to get the column names from the fact table and second step is to count the records in selected column as list.
let
Table = data,
Source = Table.FromList(Table.ColumnNames(Table), Splitter.SplitByNothing(), null, null, ExtraValues.Error),
RecordCount = Table.AddColumn(Source, "Record count", each try List.NonNullCount( List.ReplaceMatchingItems( Table.ToList(Table.SelectColumns(Table, [Column1])), {{"", null}} )) otherwise
List.Count( Table.ToList(Table.SelectColumns(Table, [Column1])) ))
in
RecordCount
I found that the List.Count or List.NonNullCount don't work as expected, as i have nulls in the list, but it counts them either way.
Solved! Go to Solution.
NewStep=Table.FromColumns({Table.ColumNames(PreviousStepName),List.Transform(Table.ToColumns(PrevousStepName),each List.Count(List.RemoveItems(_,{"",null})))},{"ColName","NoNullCount"})
NewStep=Table.FromColumns({Table.ColumNames(PreviousStepName),List.Transform(Table.ToColumns(PrevousStepName),each List.Count(List.RemoveItems(_,{"",null})))},{"ColName","NoNullCount"})
Thanks, that works, but it still takes really long time to refresh. (hour for now)
I'm not too knowledgeable in PQ, but i've read the posts and use cases for Buffer functions.
Are they any good in this case?
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
27 | |
12 | |
11 | |
11 | |
9 |
User | Count |
---|---|
53 | |
30 | |
15 | |
14 | |
13 |