locked
measure DAX RRS feed

  • Question

  • Does anyone knows how can I extract this information:

    I have Tb1 and Tb2, I need to take one column from tb1 and 1 column from tb2 (divide tb1/tb2 and show it in a new column)

    Thanks.

    Sunday, April 15, 2018 10:06 PM

Answers

  • Hi Vinicius,

    Thanks for your question.

    Assuming you have created Tb1,Tb2 and built relationships as below:

    Then you can create a calculated column called desiredcolumn as following:

    DesiredColumn = 
    Divide(Tb1[Sales Amount],RELATED(Tb2[Cost]))


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by AV111Editor Thursday, February 14, 2019 12:18 PM
    Tuesday, April 17, 2018 1:31 AM
  • Assuming that there is a relationship between Tb1 and Tb2 and that you have many records in Tb1 for each record in Tb2 you could do something like the following:

    = SUMX( Tb1, DIVIDE( Tb1[<column name>], RELATED( Tb2[<column name>] ) ) )


    http://darren.gosbell.com - please mark correct answers

    Monday, April 16, 2018 11:44 PM

All replies

  • Hey Vinicius,

    Since this forum is dedicated to questions on Power Query and the M language, I'd like to request help from the Mods here so we can move this thread to the Power Pivot / DAX forum.

    Monday, April 16, 2018 10:55 AM
  • Assuming that there is a relationship between Tb1 and Tb2 and that you have many records in Tb1 for each record in Tb2 you could do something like the following:

    = SUMX( Tb1, DIVIDE( Tb1[<column name>], RELATED( Tb2[<column name>] ) ) )


    http://darren.gosbell.com - please mark correct answers

    Monday, April 16, 2018 11:44 PM
  • Hi Vinicius,

    Thanks for your question.

    Assuming you have created Tb1,Tb2 and built relationships as below:

    Then you can create a calculated column called desiredcolumn as following:

    DesiredColumn = 
    Divide(Tb1[Sales Amount],RELATED(Tb2[Cost]))


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by AV111Editor Thursday, February 14, 2019 12:18 PM
    Tuesday, April 17, 2018 1:31 AM