Forum Discussion
how to use Calculate function in combination with values function
- 6 years ago
Hi Anno2019
Use SUMMARIZE('MainTable', 'MainTable'[Customer Name]) will create a new table with just the customers in. You can then add separate calculated columns to replace the measures you have. If you need to you can add aggregations in the SUMMARIZE. It will make that statement more complicated to follow. I like breaking things out into separate calculated columns so you can test each individual DAX statement.
See how you get on, if you get stuck let us know
Thanks, Brian
Hi Anno2019
OK, now I see what you mean!
Have you used the performance analyser view?
How many rows do you have in the main table?
I’m not sure that you can solve this how you want. Anything using iterators or if statements will be slower than doing it a different way. We tend to only see performance problems when the dataset gets beyond a certain size.
Looking at what you are doing I would be inclined to create a new calculated table that is a summary of your main table aggregated to the customer level. Then you can convert the measures you have to calculated columns so they will be processed at data load.
Thanks, Brian
My data has over 100 000 lines.
Ok, so aggregated calculated table, have not explored that yet.
I run through a video on how to.
- bpsearle6 years ago
Resolver II
Hi Anno2019
Use SUMMARIZE('MainTable', 'MainTable'[Customer Name]) will create a new table with just the customers in. You can then add separate calculated columns to replace the measures you have. If you need to you can add aggregations in the SUMMARIZE. It will make that statement more complicated to follow. I like breaking things out into separate calculated columns so you can test each individual DAX statement.
See how you get on, if you get stuck let us know
Thanks, Brian