Forum Discussion
Creating a conditional table from other tables
- 2 years ago
let Source = Table.SelectRows(#"Table 1", each ([Location] <> " ")) & #"Table 2", #"Removed Duplicates" = Table.Distinct(Source, {"Month Yr", "Location"}) in #"Removed Duplicates"
You posted this in the Power Query section. Power Query does not support dynamic source creation.
In DAX you can create calulated tables, or temporary table variables for use in measures.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Sharing an outline of the tables that I have -
Table 1
| Month Yr | Location | Function | Hrs |
| Jan-24 | A | AA | 1 |
| Jan-24 | B | BB | 2 |
| Mar-24 | C | CC | 3 |
| Apr-24 |
Table 2 -
| Month Yr | Location | Function | Hrs |
| Mar-24 | C | CC | 1 |
| Apr-24 | B | BB | 2 |
| May-24 | C | CC | 2 |
Output Result Table - It should 1st check for values in Table 1, if blank in Table 1 then take values from Table 2
| Month Yr | Location | Function | Hrs |
| Jan-24 | A | AA | 1 |
| Jan-24 | B | BB | 2 |
| Mar-24 | C | CC | 3 |
| Apr-24 | B | BB | 2 |
| May-24 | C | CC | 2 |
- lbendlin2 years agoSuper User
let Source = Table.SelectRows(#"Table 1", each ([Location] <> " ")) & #"Table 2", #"Removed Duplicates" = Table.Distinct(Source, {"Month Yr", "Location"}) in #"Removed Duplicates"