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
marcomartinetti
Regular Visitor

Insert New column using values from another column - Power BI Desktop

Hi communuty,

I would need a hand to figure out how to create a new column in an existing table by taking data from another table.

I tried to use the formula : 

CMP =
var article code = Vendite[K_CodArt]
var data = Vendite[K_DataRegistraz]
var costo = MAXX(FILTER('CMP', art = 'CMP'[Articolo] ), 'CMP'[VALORENETTOSCHEDA] )
return
costo
 
so it would work, but the problem is that I should be able to filter both the data and the article code.
 
Can you help me figure out what formula I should use to be able to use both filters??
 
thank you very much
 
Marco
 
 
5 REPLIES 5
Mahesh0016
Super User
Super User

@marcomartinetti I hope this helps you!Thank You!!
CREATE Column :
CMP = lookup([VALORENETTOSCHEDA],[Articolo],[K_CodArt])

oh wow ok! I had never used this feature.

but this feature is fine even if I have to use a double filter? item code and date? or is it just fine with a filter?

@marcomartinetti Yes , you can use in calculate function then apply filter.
For E.g
CMP = calculate(lookup([VALORENETTOSCHEDA],[Articolo],[K_CodArt]), filter(conditions)).

@marcomartinetti THANK YOU!!

marcomartinetti
Regular Visitor

thank you @Mahesh0016 

So, I would like to link to each marketing move a cost that is present in the second table

table 1                                                   table 2

marcomartinetti_0-1687174662231.png   marcomartinetti_1-1687174815357.png

 

way to merge these two tables would be by making filter for column K_CodArt and K_DataRegistraz of the first table.

the result that I would like to have would be to bring up the VALORENETTOSCHEDA column of the second tables in the first.  Such as in the image :

marcomartinetti_2-1687175015614.png

 

Thank you 

 

Marco

 

Mahesh0016
Super User
Super User

@marcomartinetti Please Share Expected OutPut in table.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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

Fabric Community Update - June 2025

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