Forum Discussion

marcomartinetti's avatar
marcomartinetti
Regular Visitor
3 years ago

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

    • marcomartinetti's avatar
      marcomartinetti
      Regular Visitor

      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?

      • Mahesh0016's avatar
        Mahesh0016
        Icon for Super User rankSuper User

        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!!

  • 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

       

     

    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 :

     

    Thank you 

     

    Marco