Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Paulyeo11
Impactful Individual
Impactful Individual

Can I add script to power quarry to load X row data only ?

Hi All

i like to know am I allow to write some script insert into M CODE section to limit load only 9 row of data to PBI. 

So I can use that for testing purpose.

Paul

2 ACCEPTED SOLUTIONS
Adamtall
Resolver III
Resolver III

Hi,

 

you can use "keep top rows" 

 

type this code in a blank query "advanced editor"

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PLchJLUlV0iGPGauDYgYxetH1kG0vmrHotuN3G43chMPLcITpbkxlWP1G47DE5yCiwxSPG1ECAdnuWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Brand Completeness" = _t, #"SC Franchise Completeness" = _t, #"Commercial Franchise Completeness" = _t, #"Varient Completeness" = _t, #"ShelfLife Completeness" = _t, #"Medically Critical completeness" = _t]),
#"Kept First Rows" = Table.FirstN(Source,9)
in
#"Kept First Rows"

 

/Adam

View solution in original post

Hi, 

 

Depends if it is a Database? 

 

 

then you can have a sql query:

like this:

---------------

select top 70
[$Table].[timestamp] as [timestamp],
[$Table].[Exclude from Accrual Report] as [Exclude from Accrual Report]
from [dbo].[EQM$G_L Entry] as [$Table]

------------------

 

or: 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PLchJLUlV0iGPGauDYgYxetH1kG0vmrHotuN3G43chMPLcITpbkxlWP1G47DE5yCiwxSPG1ECAdnuWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Brand Completeness" = _t, #"SC Franchise Completeness" = _t, #"Commercial Franchise Completeness" = _t, #"Varient Completeness" = _t, #"ShelfLife Completeness" = _t, #"Medically Critical completeness" = _t]),
#"Kept First Rows" = Table.FirstN(Source,70)
in
#"Kept First Rows"

 

/Adam

View solution in original post

4 REPLIES 4
Adamtall
Resolver III
Resolver III

Hi,

 

you can use "keep top rows" 

 

type this code in a blank query "advanced editor"

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PLchJLUlV0iGPGauDYgYxetH1kG0vmrHotuN3G43chMPLcITpbkxlWP1G47DE5yCiwxSPG1ECAdnuWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Brand Completeness" = _t, #"SC Franchise Completeness" = _t, #"Commercial Franchise Completeness" = _t, #"Varient Completeness" = _t, #"ShelfLife Completeness" = _t, #"Medically Critical completeness" = _t]),
#"Kept First Rows" = Table.FirstN(Source,9)
in
#"Kept First Rows"

 

/Adam

Paulyeo11
Impactful Individual
Impactful Individual

Hi Sir

 

how to ask PBI only load 70 row ?

Hi, 

 

Depends if it is a Database? 

 

 

then you can have a sql query:

like this:

---------------

select top 70
[$Table].[timestamp] as [timestamp],
[$Table].[Exclude from Accrual Report] as [Exclude from Accrual Report]
from [dbo].[EQM$G_L Entry] as [$Table]

------------------

 

or: 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PLchJLUlV0iGPGauDYgYxetH1kG0vmrHotuN3G43chMPLcITpbkxlWP1G47DE5yCiwxSPG1ECAdnuWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Brand Completeness" = _t, #"SC Franchise Completeness" = _t, #"Commercial Franchise Completeness" = _t, #"Varient Completeness" = _t, #"ShelfLife Completeness" = _t, #"Medically Critical completeness" = _t]),
#"Kept First Rows" = Table.FirstN(Source,70)
in
#"Kept First Rows"

 

/Adam

Paulyeo11
Impactful Individual
Impactful Individual

Hi Sir

thank you for your sharing .

i am load by CSV or TXT format 

 

paul

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Users online (3,867)