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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Stephane1974
New Member

Link between 3 tables for a new column

Hi Guys

 

here my issue. I have three tables where the key is based on an interval. 

table1: columns :

tbl1Dim2

tbl1Dim3

tblResults

 

 

table 2 : columns :

tbl2Dim2_StartInterval

tbl2Dim2_EndInterval

tbl2Results

 

table3: columns:

tbl3Dim2

tbl3Dim3

tbl3Results

 

I would like to show in table 1 tbl1Result :

 

if tbl1Dim3 in between tbl2Dim3StartInterval and tblDim3EndInterval = tbl2Result

 

if Concatenate(tbl1Dim2, tbl1Dim3) =Concatenate(tbl3Dim2, tbl3Dim3) then  tbl1Result=tbl3Result

hope I am clear enough.

 

thanks

Stephane

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

Hi @Stephane1974 ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1679451231579.png

vjianbolimsft_1-1679451243190.png

vjianbolimsft_2-1679451262317.png

Please try:

tblResults = 
var _a = FILTER('table2',[tbl2Dim3_StartInterval]<=[tbl1Dim3]&&[tbl1Dim3]<=[tbl2Dim3_EndInterval])
var _b = FILTER('table3',CONCATENATE([tbl3Dim2],[tbl3Dim3])=CONCATENATE([tbl1Dim2],[tbl1Dim3]))
return SWITCH(TRUE(),
COUNTROWS(_a)>=1,MAXX(_a,[tbl2Results]),
COUNTROWS(_b)>=1,MAXX(_b,[tbl3Results]))

Final output:

vjianbolimsft_3-1679451583857.png

Best Regards,

Jianbo Li

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

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-jianboli-msft
Community Support
Community Support

Hi @Stephane1974 ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1679451231579.png

vjianbolimsft_1-1679451243190.png

vjianbolimsft_2-1679451262317.png

Please try:

tblResults = 
var _a = FILTER('table2',[tbl2Dim3_StartInterval]<=[tbl1Dim3]&&[tbl1Dim3]<=[tbl2Dim3_EndInterval])
var _b = FILTER('table3',CONCATENATE([tbl3Dim2],[tbl3Dim3])=CONCATENATE([tbl1Dim2],[tbl1Dim3]))
return SWITCH(TRUE(),
COUNTROWS(_a)>=1,MAXX(_a,[tbl2Results]),
COUNTROWS(_b)>=1,MAXX(_b,[tbl3Results]))

Final output:

vjianbolimsft_3-1679451583857.png

Best Regards,

Jianbo Li

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

Stephane1974
New Member

With a minor correction

 

instead of 

 

if tbl1Dim3 in between tbl2Dim3StartInterval and tblDim3EndInterval = tbl2Result

 

I thought

 

if tbl1Dim3 in between tbl2Dim3StartInterval and tblDim3EndInterval then tbl1Result = tbl2Result

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.