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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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