Forum Discussion
Anonymous
2 years agoNot applicable
Filter Parameter Using Lookup Table
I have SQL data that comes through like this: EffectiveDate Balance Rate VersionID 1/31/2024 519.50 .050 1 1/31/2024 525.50 .051 2 1/31/2024 522.50 .052 3 1/31/2024 523.5...
- 2 years ago
If it is in DAX and assuming these both tables are not related, you can add these columns to the ManualTable.
Version ID, I added for self check, you don't need!
Columns:
Version ID = LOOKUPVALUE('Table'[VersionID], 'Table'[VersionID], ManualTable[ProdVersionID], 'Table'[EffectiveDate], ManualTable[EffectiveDate]) Balance = LOOKUPVALUE('Table'[Balance], 'Table'[VersionID], ManualTable[ProdVersionID], 'Table'[EffectiveDate], ManualTable[EffectiveDate]) Rate = LOOKUPVALUE('Table'[Rate], 'Table'[VersionID], ManualTable[ProdVersionID], 'Table'[EffectiveDate], ManualTable[EffectiveDate])Sample output for first few rows:
Anonymous
2 years agoNot applicable
If this is my SQL output (Table1):
| EffectiveDate | Balance | Rate | VersionID |
| 1/31/2024 | 519.50 | .050 | 1 |
| 1/31/2024 | 525.50 | .051 | 2 |
| 1/31/2024 | 522.50 | .052 | 3 |
| 1/31/2024 | 523.50 | .053 | 4 |
| 2/29/2024 | 118.50 | .021 | 1 |
| 2/29/2024 | 120.50 | .025 | 2 |
| 3/31/2024 | 225.50 | .055 | 1 |
| 3/31/2024 | 230.25 | .045 | 3 |
| 3/31/2024 | 231.50 | .050 | 5 |
And this is my manually updated/maintained lookup table (Table2):
| EffectiveDate | ProdVersionID |
| 1/31/2024 | 3 |
| 2/29/2024 | 2 |
| 3/31/2024 | 5 |
Using Table2 to filter the output from Table1, this is what I expect my output to be (Table3):
| EffectiveDate | Balance | Rate | VersionID |
| 1/31/2024 | 522.50 | .052 | 3 |
| 2/29/2024 | 120.50 | .025 | 2 |
| 3/31/2024 | 231.50 | .050 | 5 |
- sevenhills2 years ago
Super User
Do you want it in Power Query or DAX?
- sevenhills2 years ago
Super User
If it is in DAX and assuming these both tables are not related, you can add these columns to the ManualTable.
Version ID, I added for self check, you don't need!
Columns:
Version ID = LOOKUPVALUE('Table'[VersionID], 'Table'[VersionID], ManualTable[ProdVersionID], 'Table'[EffectiveDate], ManualTable[EffectiveDate]) Balance = LOOKUPVALUE('Table'[Balance], 'Table'[VersionID], ManualTable[ProdVersionID], 'Table'[EffectiveDate], ManualTable[EffectiveDate]) Rate = LOOKUPVALUE('Table'[Rate], 'Table'[VersionID], ManualTable[ProdVersionID], 'Table'[EffectiveDate], ManualTable[EffectiveDate])Sample output for first few rows: