Forum Discussion

paddy_gfb's avatar
paddy_gfb
Frequent Visitor
7 years ago

Related function showing incorrect value

Hi,

I am trying to use a RELATED() funciton to sum values from related tables.

 

I have a known accurate table shown below;

I am now trying to create a new column to sum the total, freight and freighttax. 

Here is the formula for the new column:

z Total, Freight, FreightTax = JimJobPart[Total] + related(jimjob[freight]) + related(Jimjob[Freighttax])

 

When I graph this column in a table I get the sum of this column.

 

When I click on "JobNo" 415304 from the above table (img1) the table changes to this:

This seems to be all updating and working fine except that the total is not correct. From the origional table i should be getting 25245+20+2 = 25267, but the custom column is returning 25817 for some reason. 

 

To test this, I created a new column and graphed it in a table shown below:

z Freight = RELATED(jimjob[freight])

 

 

I did the same with the value directly from the "JimJob[Freight]" column and got:

For some reason the RELATED() function is producing the wrong value. If i click through my origional table to other job numbers, some are correct and some are incorrect by different magnitudes. 

 

There is only one instance of each JobNo in both tables.

 

Am I missing something here? I am in "mixed" mode if that makes a difference, although all of the data i am dealing with in this instance is from a directquery.

8 Replies

    • paddy_gfb's avatar
      paddy_gfb
      Frequent Visitor

      Hi Affan,

      Sorry for the novice question, but how do i do this and will this also share my database data?


      Thanks for the help

      • affan's avatar
        affan
        Solution Sage

        paddy_gfb

         

        The ideal way is to create a sample pbix with not actual data. Upload the file to either dropbox or google drive and share a link.

  • v-frfei-msft's avatar
    v-frfei-msft
    Community Support

    Hi paddy_gfb,

     

    I cannot open the pbix you shared, kindly post your sample data to work around. You can export the data to csv/excel and share the file here and kindly tell me the retationship between your tables.

     

    Regards,

    Frank

    • paddy_gfb's avatar
      paddy_gfb
      Frequent Visitor

      Hi Frank,

      Thanks for the help. As i am using a live conneciton, how do i share a snapchot of the data?