Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Solved! Go to Solution.
Try using RELATED or RELATEDTABLE
Hi @mikeborg82,
RemarksThe 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.
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.
https://msdn.microsoft.com/en-us/library/ee634202.aspx
https://msdn.microsoft.com/en-us/library/ee634226.aspx
Regards
Try using RELATED or RELATEDTABLE
That works. Thanks for your help. Can you explain what it was doing? I am pretty new to powerbi.
Hi @mikeborg82,
RemarksThe 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.
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.
https://msdn.microsoft.com/en-us/library/ee634202.aspx
https://msdn.microsoft.com/en-us/library/ee634226.aspx
Regards
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |