Quantcast
Channel: All Developer posts
Viewing all articles
Browse latest Browse all 48785

Re: How to check that all expected rows were imported to power bi desktop model?

$
0
0

hxkresl wrote:

So, are you saying the data load will be all successf or all failure with no chance of partial load? 

 

The Developer asked if ld be fine with separate table providing the row count, as there is some difficulty providing within original query.

 

If I am getting seperate queries returning rowcount for tables, any best practices for automating the rowcount check?


Yes.

 

Not a best practices but you can do that with Power Query. Just replace the Source with your rowcount table. You'll have to count all rows for all tables and then the rowcount table would change according to subsequential data refresh. Check a demo in the pbix attached.

letSource = Table.FromRows({{"Table1",1},{"Table2",2},{"Table3",3}},{"tableName","expectedRowcnt"}),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"tableName", type text}, {"expectedRowcnt", Int64.Type}}),
    GetTable1RowCnt = Table.FromRows({{"Table1",Table.RowCount(Table1)}},{"tableName","actualRowcnt"}),
    GetTable2RowCnt = Table.FromRows({{"Table2",Table.RowCount(Table2)}},{"tableName","actualRowcnt"}),
    GetTable3RowCnt = Table.FromRows({{"Table3",Table.RowCount(Table3)}},{"tableName","actualRowcnt"}),
    UninonRowCntTbls = Table.Combine({GetTable1RowCnt,GetTable2RowCnt,GetTable3RowCnt}),
    MergeSourceAndUninonRowCntTbls = Table.Join(Source ,"tableName", UninonRowCntTbls ,"tableName")
in
    MergeSourceAndUninonRowCntTbls

Capture.PNGCapture2.PNGCapture3.PNGCapture4.PNG


Viewing all articles
Browse latest Browse all 48785

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>