The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have 2 tables, Accounts and Info.
Accounts Table looks like this, only with millions of rows:
From | To | Account Type |
100156 | 120211 | ABC Account |
432215 | 554532 | XYZ Account |
And Info Table looks like this, only with millions of rows:
Irrevelant Columns for this question | Account |
irrelevant data for this question | 113456 |
irrelevant data for this question | 498777 |
I need to append 'Account Type' column from 'Accounts' table, over to 'Info Table' based on the values of 'From' and 'To'.
Therefore obtaining this:
Ideal Info Table
Irrevelant Columns for this question | Account | Account Type |
irrelevant data for this question | 113456 | ABC Account |
irrelevant data for this question | 498777 | XYZ Account |
How can I do this?
Try this calculated column in the Info table:
Account Type =
VAR vAccount = Info[Account]
VAR vResult =
MAXX (
FILTER ( Accounts, vAccount >= Accounts[From] && vAccount <= Accounts[To] ),
Accounts[Account Type]
)
RETURN
vResult
Proud to be a Super User!
Hi @DataInsights !
It only mapped the last one of the Account Types. For example, out of account types ABC, DEF and XYZ, it only mapped the accounts of type 'XYZ', all the rest of the column were left blank.
Would you be able to provide examples? You can paste the data as a table or use a file service like OneDrive.
Proud to be a Super User!