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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.