Forum Discussion

Rodrigo's avatar
Rodrigo
Frequent Visitor
10 years ago
Solved

How to calculate between querys

Hi Everyone, 

 

My problem here is that on my Raw data I would like to add a column (NSAT) with the following calculation:

  VerySatisifed - Somewhat Dissatisfied+ 100

 

 

Since they are in different tables I have being unable to perform this, hopeffuly you can help me with my question. 

 

Thank you, 

 

Rod

  • Hi Rodrigo,

     

    According to your description, you need to add a calculated column to get the value from other tables, right?

     

    In DAX, we can use LOOKUPVALUE function to get the value from other table. This function returns the value in result_columnName for the row that meets all criteria specified by search_columnName and search_value.
    https://msdn.microsoft.com/en-us/library/gg492170.aspx

    Regards,

    Charlie Liao

4 Replies

  • Rodrigo Are the structures of the tables the same? If so then you could merge them all together using the merge function in the query editor.

     

    Can you show a n example of the table structures?

     

    Giles

    • Rodrigo's avatar
      Rodrigo
      Frequent Visitor

      Acutally I just realize that is not only a different table that I am trying to reach here but inside of the Somewhat Dissatisfied table I need an especific column. So the calculation changes a little: 

       

       

      the operation should be considering the mr_string_value column that is inside of the somewhat dissatisifed table minus the mr_string_value which is on the Very Satisfied table. 

       

      answering to your question, yes they do have the same instructure as you can see on the pics. 

       

      NSAT: = ('Somewhat Dissatisfied'[mr_string_value]-'Very Satisfied'[mr_string_value]+100)

       

      but still not working :( 

       

       

      Thanks for your help 

      • Rodrigo's avatar
        Rodrigo
        Frequent Visitor

         

        instead of using the mr_string_value column I am using the count column witch makes more sanse because that one does has the value but still not working.