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 August 31st. Request your voucher.
How can I return a value from Table B based on the account number in Table A being between a range set in Table B.
Table A:
Table B:
I want to create a column in Table A returnining values from the "Class" column in Table B based on the account number from Table A falling in the range of Table B's "SEG 3 BEgin" and "SEG 3 End". For example, I want the value "Operating Expense" returned for a Table A account "4005".
Hi @justinblackmor -
Try creating a column on Table A with this kind of DAX pattern
Class =
VAR __ThisRow = TableA[Account]
VAR __minAcc =
MAXX (
FILTER (
ALL ( TableB ),
__ThisRow >= TableB[SEG3 Begin]
&& __ThisRow <= TableB[SEG 3 End]
),
TableB[SEG 3 Begin]
)
VAR __maxAcc =
MINX (
FILTER (
ALL ( TableB ),
__ThisRow >= TableB[Seg 3 Begin]
&& __ThisRow <= TableB[Seg 3 End]
),
TableB[Seg 3 End]
)
RETURN
LOOKUPVALUE (
TableB[Class],
TableB[Seg 3 End], __maxAcc,
TableB[Seg 3 Begin], __minAcc
)
Hope this helps
David
User | Count |
---|---|
26 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
30 | |
14 | |
12 | |
12 | |
7 |