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.
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
Solved! Go to 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:
From the original 'Table 1'
Proud to be a Super User!
@Anonymous -
So what are the expected Performance values in your sample?
Proud to be a Super User!
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?
Proud to be a Super User!
@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:
From the original 'Table 1'
Proud to be a Super User!
@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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |