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.
Lets say I have two values, SalesAmount and DiscountAmount. SalesAmount minus the DiscountAmount is the NetSaleAmount.
I can create a measure something like: NetSaleAmount = (SUM(SalesAmount) - SUM(DiscountAmount).
or
I can create two measures, one for SalesAmount and one for DiscountAmount and do something like: NetSalesAmount = [SalesAmount] - [DiscountAmount]?
If I have to use the NetSalesAmount result in other measures in my model which way is better for overall performance in the model?
Solved! Go to Solution.
@PBInterest There shouldn't be any real performance difference I would not think as either way DAX should essentially produce the same end query. You can check this using DAX Studio or by using the Performance Analyzer and copying the DAX query produced and comparing.
Really, boils down to a preference and if you need to use Sales Amount and Discount Amount in other measures. Many people advocate for creating simple aggregation measures for base value columns and then hiding the columns and only exposing the measures. The downside to this is that if you need a bunch of different aggregations, SUM, AVERAGE, MAX, MIN, etc. you can end up with a lot of base measures which might create confusion.
@PBInterest There shouldn't be any real performance difference I would not think as either way DAX should essentially produce the same end query. You can check this using DAX Studio or by using the Performance Analyzer and copying the DAX query produced and comparing.
Really, boils down to a preference and if you need to use Sales Amount and Discount Amount in other measures. Many people advocate for creating simple aggregation measures for base value columns and then hiding the columns and only exposing the measures. The downside to this is that if you need a bunch of different aggregations, SUM, AVERAGE, MAX, MIN, etc. you can end up with a lot of base measures which might create confusion.
That's helpful, thanks for the reply.
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 |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |