Forum Discussion

HelpNeeded21's avatar
HelpNeeded21
Frequent Visitor
6 years ago
Solved

Multiplying column with different values in another table

Hello Everyone, I need help, the case is the next:

 

I have a table with a lot of transactions (invoiced sales, quantities, part numbers) and I have another table with the white list price by country (the "white list price"  include all prices without discounts), so I'd like to add a new column with the invoiced sales with the "white list price" according to the countries. 

 

I hope someone can help me.

 

  • HelpNeeded21 

    You can have new columns like

    white list price = Minx(filter('white list price','white list price'[country] ='transactions '[country] ),'white list price'[price])
    or
    white list price = Minx(filter('white list price','white list price'[country] ='transactions '[country] && 'white list price'[item] ='transactions '[item]),'white list price'[price])

     

     

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    So, sample data would be tremendously helpful. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

     

    Assuming you have a Country column in your first table, you could do something like this:

    Column =
      VAR __Country = 'Table'[Country]
      VAR __WhiteListPrice = 
        LOOKUPVALUE(
          'White List Price Table',
          'White List Price Table'[White List Price],
          'White List Price Table'[Country],
          __Country
        )
    REUTRN
      __WhiteListPrice

     

  • HelpNeeded21 

    You can have new columns like

    white list price = Minx(filter('white list price','white list price'[country] ='transactions '[country] ),'white list price'[price])
    or
    white list price = Minx(filter('white list price','white list price'[country] ='transactions '[country] && 'white list price'[item] ='transactions '[item]),'white list price'[price])