Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
KaZeK
Frequent Visitor

Assigning range to value from not connected, different table

Dear Community, 

 

I have a doubt and I do not have any idea how to handle it. Basically I have two tables, one of them contains thousends of raws with unique name and specific value:

 

name1      value1

...               ...

...               ...

nameX       valueX

 

In the second table I am calculating Ranges, the result of this calculation is the table like below:

 

KaZeK_0-1666639636758.png

 

 

How to assign range from second table to the value from table number one, and add column in table one where I will provide correct Range Name? I Unfortunately I cannot use LOOKUPVALUE() function due to the fact that tables are not connected... I know SWITCH() function, but I do not know how to use values from not connected table...

 

Finally, I need to get table like below:

 

name1      value1    RangeName1 (column name from 2nd table: SR30PeriodNameX)

...               ...

...               ...

nameX       valueX  RangeNameX

 

Please, help me... It cannot be so difficult...

 

Regards

Kazek

1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @KaZeK ,

 

Please try following DAX:

 

RangeName = MAXX(
    FILTER(
        'SR30_periods_adj',
        'SR30_periods_adj'[SR30PeriodMinValue] <= EARLIER('StockList'[SR30]) &&
        'SR30_periods_adj'[SR30PeriodMaxValue] >= EARLIER('StockList'[SR30])),
        'SR30_periods_adj'[SR30PeriodName]
)

 

 

I think this is the result you want:

vyadongfmsft_0-1666863552871.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yadongf-msft
Community Support
Community Support

Hi @KaZeK ,

 

Please try following DAX:

 

RangeName = MAXX(
    FILTER(
        'SR30_periods_adj',
        'SR30_periods_adj'[SR30PeriodMinValue] <= EARLIER('StockList'[SR30]) &&
        'SR30_periods_adj'[SR30PeriodMaxValue] >= EARLIER('StockList'[SR30])),
        'SR30_periods_adj'[SR30PeriodName]
)

 

 

I think this is the result you want:

vyadongfmsft_0-1666863552871.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dear v-yadongf-msft

 

Thank you so much. It works perfectly!!!

 

Regards

KaZeK

KaZeK
Frequent Visitor

Hello, 

 

I am sharing file with data. The main question is how to define range for SR30 value located in StockList table, where ranges are calculated and provided in second table - SR30_periods_adj (tables are not connected), and finally how to copy range name - SR30PeriodName - from second table - SR30_periods_adj to table StockList.

 

KaZeK_0-1666723148257.png

 

https://drive.google.com/file/d/1H9x2V7dxnPRqr4FtY2ojMAqCu_7ks4cw/view?usp=sharing 

 

Regards

KaZeK

 

Anonymous
Not applicable

Hello what do you mean by range? Like maxvalue - min value? And can you provide a sample to download or use?

Hello Eliasayy,

 

I mean that Value from table number one belongs to the range from table number two. It means, my Value is bigger then lower range (SR30PeriodMinValue) and lower then higher range (SR30PeriodMaxValue). When Value and range is defined I would like to take range name (SR30PeriodName) and copy this name to table number one.

 

regards

Kazek

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.