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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Vlookup with Filter/Specific Return

Hi everyone - maybe I'm going about this wrong, I know there's so many ways to do one thing with PowerBI/Query. But let me know your thoughts please - 

 

I'm need to pull in data into a new column, [Vlookup] based on a unique variable from one table to another, but ensure that the lookup pulls in the most recent FiscalYear date performance score. 

 

See the attached with how the 3 tables are structured. 

 

How would you DAX write this? Or is there and easier way to do this in PowerQuery 

 

 

DateFiscalYearPerformance.PNG

1 ACCEPTED SOLUTION

@Anonymous -

 

I am not going to say your 'Date' table is irrelevant, I am just unsure how you're planning on declaring which is the "more recent FiscalYear date performance score". 

 

For example the current FY is FY20 correct? 'Table 1' has [Year] <= 2019 but yet 'Table 2' is supposed to return [Year] = 2018, how is that? I also see that 10/1/2016 is declared as FY18 [Year] = 17, I do not understand how this came to be.

 

The Table I created says:

Add a column to a table of  distinct [Unique ID]. This column is called "Year" and "Year" is the MAX [Year] - 1. 2019 - 1 = 2018.
Add a column, "Performance", where [Unique ID] is equal to [Unique ID] and [Year] is equal to MAX[Year] -1

 

This produces:

1.PNG

 

From the original 'Table 1'

 

2.PNG

 






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

7 REPLIES 7
ChrisMendoza
Resident Rockstar
Resident Rockstar

@Anonymous -

So what are the expected Performance values in your sample?






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

It would be based on the year indication in Table 2. So the first row would return 80 second row would return 80. 😛 And so on. 

 

Thank you for trying to help!!! 

@Anonymous -

I am unsure what Table 3 relates to.

 

I created the following (to replace your 'Table 2') however I don't believe it is what you are going for.

Table = 
ADDCOLUMNS (
    DISTINCT ( 'Table 1'[Unique ID] ),
    "Year", MAX ( 'Table 1'[Year] ) - 1,
    "Performance", LOOKUPVALUE (
        'Table 1'[Performance],
        'Table 1'[Unique ID], 'Table 1'[Unique ID],
        'Table 1'[Year], MAX ( 'Table 1'[Year] ) - 1
    )
)

Maybe you could explain more about how 'Table 3' relates?






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

@ChrisMendoza  Table 3 is just a regular date table, allowing me to convert date to FiscalYears...so I guess it would be irrelevant. 

 

Trying to pull in the performance associated with the year in Table 1 and Table 2. Ideally in a new column in Table 2. 

 

Thanks Much! 

@Anonymous -

 

I am not going to say your 'Date' table is irrelevant, I am just unsure how you're planning on declaring which is the "more recent FiscalYear date performance score". 

 

For example the current FY is FY20 correct? 'Table 1' has [Year] <= 2019 but yet 'Table 2' is supposed to return [Year] = 2018, how is that? I also see that 10/1/2016 is declared as FY18 [Year] = 17, I do not understand how this came to be.

 

The Table I created says:

Add a column to a table of  distinct [Unique ID]. This column is called "Year" and "Year" is the MAX [Year] - 1. 2019 - 1 = 2018.
Add a column, "Performance", where [Unique ID] is equal to [Unique ID] and [Year] is equal to MAX[Year] -1

 

This produces:

1.PNG

 

From the original 'Table 1'

 

2.PNG

 






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

@ChrisMendoza  Thank you for your patience with this. 😉 

 

Apologies that is actually misleading as it's a typo. 10/1/2016 = FY17. 🙂 Our fiscal year starts 10/1 each year and ends 09/30 each year. 

 

I'm going to try to create this new table and see what happens.

Hi @Anonymous ,

 

If above post  provided by @ChrisMendoza  helps ,please kindly mark the answer as solution. thanks!

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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