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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
apoje
Helper II
Helper II

How to replace one item with a different one – apply transformation?

Hi,

 

I would like to transform one of my items in the database based on its variation number.

The end result would be a transformation of the variation number and multiplication of its quantity column.

 

 

Initial data - I want to apply the transformation on the variation 0527: 

Order.IDVariation.NumberQuantity
12305275
124123410
12512391

 

 

dataset with the applied transformation (variation number 0527 was transformed to 1999 and its quantity multiplied by 10):

Order.IDVariation.NumberQuantity
123199950
124123410
12512391

 

Would something like that be possible?

 

Also, my data set is 100000 lines – I imagine this is not too much for PQ 😊

 

Thanks for the help!

Andraz

1 ACCEPTED SOLUTION
shaowu459
Resolver II
Resolver II

Hi, @apoje 

 

Try this, for 100,000 lines please wait about 20 seconds to upload to excel.

let
    Source = Excel.CurrentWorkbook(){[Name="Table25"]}[Content],
    Custom1 = Table.FromRecords(List.Transform(Table.ToRecords(Source),each if [Variation.Number]="0527" then _&[Variation.Number=1999]&[Quantity=[Quantity]*10] else _))
in
    Custom1

1.png 

View solution in original post

4 REPLIES 4
shaowu459
Resolver II
Resolver II

Hi, @apoje 

 

Try this, for 100,000 lines please wait about 20 seconds to upload to excel.

let
    Source = Excel.CurrentWorkbook(){[Name="Table25"]}[Content],
    Custom1 = Table.FromRecords(List.Transform(Table.ToRecords(Source),each if [Variation.Number]="0527" then _&[Variation.Number=1999]&[Quantity=[Quantity]*10] else _))
in
    Custom1

1.png 

@shaowu459 awesome! Do you know on the upper limit for lines of data to be still acceptable to use PQ?

This one is faster than the Record one.

let
    Source = Excel.CurrentWorkbook(){[Name="dataset"]}[Content],
    res = Table.ToList(Source,each if _{1}="0527" then {_{0},1999,_{2}*10} else _)
in
    Table.FromRows(res,{"Order.ID","Variation.Number","Quantity"})

 

I don't know the exact upper limit, But  several million lines would not be problem. For large data, you may import and export from CSV, access, sql, etc.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors