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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
alex779
Frequent Visitor

adding columns whose values are also based on scaling values in different table

Hello there!

 

Have 2 tables (PVprod and StrutturaCER). I need to add new columns named "Pn" (n=1,2,...) to first table PVprod.
Pn = reference column IRR * a scaling coefficient PVnew[n] taken from column PVnew of the second table "StrutturaCER", where n is the row index of PVnew (see pics below)


Is this at all possible in P.Bi ?

I'd like to get as many new colums added to table PVprod for all values of PVnew (including zero values).

Any idea / suggestion  in DAX?

Thanks a lot, Alex

alex779_0-1706114336704.png

alex779_1-1706114760162.png

 

 

6 REPLIES 6
alex779
Frequent Visitor

THanks a lot both guys. Would like to attach my pbix example file but HOW???? 
I drag the pbix here but got "file type (.pbix) is not supported." Cannot find the icon to attach file anywhere.

wdx223_Daniel
Super User
Super User

M Code

=Table.FromRecords(Table.TransformRows(PVprod,each Record.TransformFields(_,List.Transform(List.Position(StrutturaCER[PVnew]),(r)=>{"P"&Text.From(r),(x)=>[IRR]*StrutturaCER[PVnew]{r}}),2)))

Hi, thanks but getting this error. Seems a "ciclic error during evaluation"

alex779_0-1706203941573.png

alex779_1-1706204000669.png

 

 

it's not a formula in Custom Column

it's a whole step code, try to delete Table.AddColumn outside

Anonymous
Not applicable

Hi, @alex779 

Based on the information you have provided, I created two tables, Table1 and Table2.

vyilongmsft_0-1706166439109.png
vyilongmsft_1-1706166439111.png

Then New Column, multiply ScalingFactor of Table2 and Value1 of Table1 to get a new column.

 

Column = 
     Table1[Value1] * RELATED(Table2[ScalingFactor])

 

vyilongmsft_2-1706166571585.png

 

This enables calculations across tables, so if you want to do more with your table, provide me with more data.

 

How to Get Your Question Answered Quickly 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thank you but my tables are NOT of the same size.. So it does not work for me.
My Table1 is like 9000 rows and Table2 (scalingfactors) only 10 rows. I had to rescale each of the 9000 cells IRR in a new column with scaling factors taken from Table2, and add as many columns as the 10 scaling factors.. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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