VLOOKUP in PowerPivot

funky2406

New Member
Joined
Apr 4, 2014
Messages
4
Hi

this is my first post. I think this question has been asked already before but I wasn't able to understand the answers so please be patient with me.
I'm quite new in PowerPivot and I am trying to convert an old excel file in a new one using PowerPivot.

In my PowerPivot I have two tables (linked to excel tables):

- the first table called "dimCars"<dimcars> with two fields: [BrandID] and [Brand]
- the second table called "factSales"<factsales> with three fields: [Date], [BrandID], [CustomerID]

Extract of the two tables as follows:

table: "dimCars"<dimcars></dimcars>
BrandID
Brand
1000
VW
1001
Audi
1002
Mercedes Benz
1003
Toyota
1004
Hyundai
1005
Volvo
1006
Renault
1007
Nissan

<tbody>
</tbody>

table: "factSales"<factsales></factsales>
Date
BrandID
CustomerID
CalculatedColumn: Brand
11.12.2013
1000
A001245
=VLOOKUP([@BrandID];dimCars[#All];2;FALSE)
24.01.2014
1004
A002486
Hyundai
16.02.2014
1001
B00486
Audi
27.02.2014
1002
C04663
Mercedes Benz
01.03.2014
1003
A003496
Toyota
18.03.2014
1006
Z45069
Renault
29.03.2014
1007
YA48060
Nissan
02.04.2014
1004
D048804
Hyundai

<tbody>
</tbody>



The relationship between the two tables is a one to one relationship between the [BrandID] Primary Key in the parent table "dimCars" and the [BrandID] Foreign Key in the child table "factSales"<dimcars[brandid]><factsales[brandid]> .

In the second table ("factSales"<factsales>) in PowerPivot I want to add a calculated column that will lookup the [BrandID] value and will return the corresponding [Brand] value from the <dimcars> table "dimCars".

In a few words, I want to do a VLOOKUP formula (I wrote the Excel VLOOKUP formula in the table "factSales" for more detail), but i just want to do it in PowerPivot using DAX.

Until now I searched everywhere in google and in several posts but didn't find the answer to this.
Am I wanting to do something wrong?
Is there a way to do this in PowerPivot?

Your reply(es) would be greatly appreciated!
Thanks in advance
Frank</dimcars></factsales></factsales[brandid]></dimcars[brandid]></factsales></dimcars>
 

Some videos you may like

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

GDRIII

Board Regular
Joined
May 30, 2014
Messages
88
I think your calculated column in factSales needs to be simply:

=REALATED(dimCars[Brand])
 

funky2406

New Member
Joined
Apr 4, 2014
Messages
4
hi GDRIII

thanks for the reply.
I will try it later at home (I don't have PowerPivot in the office :(.
I will let you know how it works.
Cheers
Frank
 

StudentITE

New Member
Joined
Nov 26, 2014
Messages
1
Since " =REALATED(dimCars[Brand]) " worked in the calculated column in factSales was the reason that VLOOKUP is just not compatible with this particular table and if so in what instance would VLOOKUP be suitable in PowerPivot?
 

Tianbas

Board Regular
Joined
Apr 29, 2014
Messages
101
... was the reason that VLOOKUP is just not compatible with this particular table and if so in what instance would VLOOKUP be suitable in PowerPivot?
There is no VLOOKUP in PowerPivot/Dax, the formula that is similar is called RELATED() but in most cases you do not even need that as the "lookup"-connection between your tables is already working when you create a relationship between the tables.

In the example above you can create the calculated column with RELATED() as proposed by GDRIII or you can use the brand and/or brand ID from dimCars table in a pivot to see the sales per brand from fact table
 

Forum statistics

Threads
1,089,422
Messages
5,408,148
Members
403,186
Latest member
123hpeinstall

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top