Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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
Solved! Go to Solution.
Hi @Stephane1974 ,
Based on your description, I have created a simple sample:
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:
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.
Hi,
Share some data to work with and show the expected result.
Hi @Stephane1974 ,
Based on your description, I have created a simple sample:
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:
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.
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 23 |