Forum Discussion

Domenick's avatar
Domenick
Helper IV
6 years ago
Solved

Help subtracting columns between two joined tables

 

I've simplified my problem so that all I need to do is subtract a column in one table from a column in another table. There is a one-to-one relationship between the two tables, so I don't see why this is so complicated. It still won't let me subtract without aggregation. This is really frustrating. Can anyone help?

  • If there is a one-to-one relation, then you can add a calculated column like this:

     

    CalcColumn = Table1[BaseColumn] - RELATED(Table2[SubtractColumn])

     

    That should work. 

    Kind regards

    Djerro123

    -------------------------------

    If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

    Keep those thumbs up coming! 🙂

     

6 Replies

  • JarroVGIT's avatar
    JarroVGIT
    Resident Rockstar

    If there is a one-to-one relation, then you can add a calculated column like this:

     

    CalcColumn = Table1[BaseColumn] - RELATED(Table2[SubtractColumn])

     

    That should work. 

    Kind regards

    Djerro123

    -------------------------------

    If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

    Keep those thumbs up coming! 🙂

     

  • CoreyP's avatar
    CoreyP
    Solution Sage

    Can you just merge the two tables together? Then just add a calc column of: [Column1] - [Column2]

     

    • Domenick's avatar
      Domenick
      Helper IV

      Thanks for the suggestion; I'll give it a shot. It just seems like a really simple operation that I should be able to do if the tables are joined properly, so it's frustrating that it doesn't behave as expected.

    • Domenick's avatar
      Domenick
      Helper IV

      I'm a little confused. The merging feature doesn't seem to work like I'm expecting. After it completes the merge, both tables appear unchanged. And there's no new table or anything. If you've tried this before, can you tell me what I'm missing? CoreyP