Forum Discussion

gbarr12345's avatar
gbarr12345
Post Prodigy
2 years ago
Solved

Relationship query

Hi everyone,   I have a query I hope you'd be able to help with.   I have data that I've had to split between Business Central Only and Tasmanian data that's in Business Central and I created two...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,gbarr12345 
    Thank you for your replay.

    According to the test data you provided in your second reply, I found the possible problem:It may still be due to the wrong data in the data source, which leads to the final Amount will show the results

    Here is my test (check the process: you can also try similar steps to find out)

    Here is the test file you provided

    The tables where I think there are data problems are in these tables

    The filtering relationship between them is as follows:

     

    When Customer ID = 27, if in accordance with the requirements of the Tas Data table at this time in the field Tasman Only or BC & Tas = “TO”, then the Amount should be filtered, the three lines of data are blank, in this case, sum(Amount) The result of the calculation is blank, but in fact, according to the data you can provide to see, finally filtered out the three rows of data is not empty (100,48,350) so the final in the visual presentation of the results of the calculation sum of amount = 100 + 48 + 350 = 498

    like this.

    So I think there is something wrong with your original data, you can replace the original sum of Amount by creating  measure

    like this :

    M_SUM_Amount = 
     IF(SELECTEDVALUE('Tas Data'[Tasman Only or BC & Tas])="TO",
     BLANK(),
     CALCULATE( SUM('Sales Table'[Amount]),FILTER(ALL('Sales Table'),'Sales Table'[Customer ID]=MAX('Sales Table'[Customer ID] )))
     )
    

    Looking forward to your replay.

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

    Best Regards,

    Carson Jian,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.