Forum Discussion

mikeborg82's avatar
mikeborg82
Advocate II
9 years ago
Solved

DAX help

I am trying to create a new measure based on two other columns.  I want to create a column that tells me the average increase of salaries... I have both before and after.  When I create the DAX column I cannot seem to get any fields from that table into the formula.  I have tried closing, refreshing, etc... Any ideas of what I can do. This is the first time Ive had this happen.

 

Thanks.

  • Hi mikeborg82,

    Remarks
    The RELATED function requires that a relationship exists between the current table and the table with related information. You specify the column that contains the data that you want, and the function follows an existing many-to-one relationship to fetch the value from the specified column in the related table. If a relationship does not exist, you must create a relationship.

    When the RELATED function performs a lookup, it examines all values in the specified table regardless of any filters that may have been applied.

    System_CAPS_ICON_note.jpg Note


    The RELATED function needs a row context; therefore, it can only be used in calculated column expression, where the current row context is unambiguous, or as a nested function in an expression that uses a table scanning function. A table scanning function, such as SUMX, gets the value of the current row value and then scans another table for instances of that value.



    For more details about RELATED and RELATEDTABLE function, you can refer to the following two articles. :smileyhappy:

    https://msdn.microsoft.com/en-us/library/ee634202.aspx

    https://msdn.microsoft.com/en-us/library/ee634226.aspx

     

    Regards

4 Replies

    • mikeborg82's avatar
      mikeborg82
      Advocate II

      That works.  Thanks for your help.  Can you explain what it was doing?  I am pretty new to powerbi.

       

       

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        Typically when creating DAX custom column is that the context is constrained to the table that you are in. To change context, one can use things like RELATED and RELATEDTABLE to change the context in which the DAX operates.