Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance 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 |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |