Forum Discussion
Reference a dimension table column in PQE
- 10 months ago
Hi WillBeeSEA ,
In your fact table, try using this code in a new custom column:
Table.SelectRows(Products, (dim) => dim[Product] = [Product])[PrepDays]{0}This will bring in the [PrepDays] value from the dim table against each matching value of Product in the fact table.
Depending on the size of the Products table, you may find that PQ has to scan the table many times to find matches. In this case, you can buffer the Products table to hold it in memory while scanning, avoiding the need for multiple loads:
Table.SelectRows(Table.Buffer(Products), (dim) => dim[Product] = [Product])[PrepDays]{0}Pete
Hi WillBeeSEA ,
In your fact table, try using this code in a new custom column:
Table.SelectRows(Products, (dim) => dim[Product] = [Product])[PrepDays]{0}
This will bring in the [PrepDays] value from the dim table against each matching value of Product in the fact table.
Depending on the size of the Products table, you may find that PQ has to scan the table many times to find matches. In this case, you can buffer the Products table to hold it in memory while scanning, avoiding the need for multiple loads:
Table.SelectRows(Table.Buffer(Products), (dim) => dim[Product] = [Product])[PrepDays]{0}
Pete
Hi Pete,
Thank you for your input. I used each of the strings you gave me, but the column still returns errors on each row. Perhaps my reach has exceeded my grasp at this point in learning M. I will go back to merging the dimension field into the fact table and using it that way.
Will