March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
I need your help to get data from table 2 if some conditions are met there, and this in power query. I have a ref that I can found in both table, and I need to retrieve the "to return value" if Date from table 1 is within Start and End date of table 2. There are overlap in date for the same ref in Table 2, in such case I just need the first value that match the critera. This is what I have:
Table 1
Ref | Date |
1 | 05.01.2022 |
2 | 03.03.2023 |
1 | 01.03.2023 |
1 | 18.02.2022 |
3 | 13.08.2022 |
... | ... |
Table 2
Ref | Start Date | End Date | Value to return |
1 | 01.01.2000 | 31.12.2002 | abc |
1 | 01.01.2022 | 30.06.2022 | def |
1 | 01.01.2022 | 30.11.2022 | azt |
2 | 01.01.2023 | 31.03.2023 | uir |
The result I am looking for
Ref | Date | Returned value |
1 | 05.01.2022 | def |
2 | 03.03.2023 | uir |
1 | 01.04.2023 | null |
1 | 18.02.2022 | def |
3 | 13.08.2022 | azt |
... | ... | ... |
Thanks in advance for your help!
Is IT because you See an Error or is it not selectable? Do you have the right linkage? Or is it just a Table as visual? Then you have to get the Data in the Backend Tables. Otherwise try to geht an measure feom your Table with calcualte(values( which you can select in the If Statement
Tables are well connected, however IF statement cannot compare a value from a cell to a table, I guess.
Hi,
maybe you can try Something Like that
= If( And("Date Table 1" > " start Date table 2", "Date Table 1"< "end Date Table2), Firstnonblank(value to Return, value to Return), "Else condition"))
Im new with Firstnonblank, but it worked for me to Type in the returning value twice.
Best
That would be great, but you cannot even select any field from table 2 with a simple if statement
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
90 | |
90 | |
66 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |