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.
Hi I have two tables one is my fact tabe which has qty of items sold and another table which has the net weight for each product. I want to calculate the net weght of product sold by QTY * Net wgt. Currently I use the RELATED function to import from the lookup table to another column, but is their a better solution?
Solved! Go to Solution.
You could avoid using a calculated column with the following measure:
Net Weight Sold = SUMX ( tbl_SAP_Data, tbl_SAP_Data[Net Qty] * RELATED ( tbl_Prod_Description[Net Weight (g)] ) )
This measure will iterate over each row in the tbl_SAP_Data table. In each row, it will multiple the [Net Qty] column by the appropriate [Net Weight (g)] column from your lookup table, thanks to using RELATED() within the row context created by iterating with SUMX.
You could avoid using a calculated column with the following measure:
Net Weight Sold = SUMX ( tbl_SAP_Data, tbl_SAP_Data[Net Qty] * RELATED ( tbl_Prod_Description[Net Weight (g)] ) )
This measure will iterate over each row in the tbl_SAP_Data table. In each row, it will multiple the [Net Qty] column by the appropriate [Net Weight (g)] column from your lookup table, thanks to using RELATED() within the row context created by iterating with SUMX.
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |