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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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