Forum Discussion

Thiagops's avatar
Thiagops
Icon for Helper II rankHelper II
3 years ago

Column with information from another table

Good morning,

I need to create a column in the CUSTOMERS (WALLET) table.
This column will pull information from the PEDIDO_VENDA table (Date of the last quote made by the customer).
I can't relate the two tables because it generates ambiguity with another table (SELLERS).
Follow the formula below and screen prints:

 

Data da última cotação =
CALCULATE(
MAXX ( RELATEDTABLE ( PEDIDO_VENDA ), PEDIDO_VENDA[PV_DATA_PEDIDO] ),
PEDIDO_VENDA[PV_TIPO] = "COTAÇAO",
PEDIDO_VENDA[CFOP_CODIGO] = "5102" ||
PEDIDO_VENDA[CFOP_CODIGO] = "6102"
)

 


In the case below, it should pull the most recent date (09/09/2022), but the result comes out 03/02/2023

 

1 Reply

  • Adamboer's avatar
    Adamboer
    Icon for Responsive Resident rankResponsive Resident

    Based on the provided information, it seems like there may be an issue with the formula used to pull the information from the PEDIDO_VENDA table. Here are some steps you can try to troubleshoot the issue and get the correct date:

    1. Double-check that the formula is entered correctly with no typos or missing information.
    2. Verify that the PEDIDO_VENDA table contains the correct date for the last quote made by the customer. If the date in the table is incorrect, it will not pull the correct date in the CUSTOMERS (WALLET) table.
    3. Check if there are any filters applied to the data that may be affecting the results. Make sure that there are no filters on the PEDIDO_VENDA table that are causing it to exclude the most recent date.
    4. If the issue persists, consider seeking assistance from a database administrator or specialist who can provide further troubleshooting and support.