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 have a table showing yearly Sales and Profit values at specific years for two different companies:
Another table specifies reference years for each company.
I would like a DAX expression to calculate a new column "Value_at_RefYear" showing for each company the Sales and Profit at reference year as specified in the RefYear table:
Thanks for any help on this!
Karim
Solved! Go to Solution.
@Anonymous
Try with this column
Value at Ref Year Column = CALCULATE ( SUM ( Sales_and_Profit[Value] ), FILTER ( ALLEXCEPT ( Sales_and_Profit, Sales_and_Profit[Company], Sales_and_Profit[Attribute] ), Sales_and_Profit[Year] = RELATED ( RefYear[Year] ) ) )
@Anonymous
Try with this column
Value at Ref Year Column = CALCULATE ( SUM ( Sales_and_Profit[Value] ), FILTER ( ALLEXCEPT ( Sales_and_Profit, Sales_and_Profit[Company], Sales_and_Profit[Attribute] ), Sales_and_Profit[Year] = RELATED ( RefYear[Year] ) ) )
Hi Zubair,
Thanks, it worked perfectly and also helped me understand a bit more about the combined use of the CALCULATE and FILTER functions.
Cheers
Karim
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 | |
98 | |
79 | |
64 | |
56 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |