Forum Discussion
Need advise to improve performance
Before a post, a new topic read already posted answers about improving Power BI/Power Query performance. Sorry for creating a new one - as I think my case is unique :)
Situation:
I have two kinds of data with a larger number of entries and some "support" tables, which are used as criteria. The first table contains journal entries from ERP and second one budgeting system. The task is to create financial reports with different KPI.
To achieve it, I need to make many modifications/calculations on first two table - to organize them and unite for the report needs.
Right now did not finish my task, as during development/creation process my Power BI becomes slower with each step.
All modifications can be grouped: calculations(math operations), table modifications (pivot/unpivot, removing columns, sorting), grouping values by criteria, merging tables (adding new values from another table).
I guess that there should be like a priority for all those modifications - like grouping data before calculations (to get a balance it can be done in two ways: a) subtract from debit credit and after group values for account b) group values as first and after subtract debit from credit); to avoid table merging as much as possible. Where will calculation work faster - in power query or power bi (as measures) - as there is need to create cumulative values (end of the period from start of the year)?
Hi Girts,
in the link I've provided you'll also find a reference to this article: https://exceleratorbi.com.au/calculated-columns-vs-measures-dax/ which looks very relevant to me: Rentability % is mooost likely a case for measures (think a about the subtotals in your visualisations).
5 Replies
- AnonymousNot applicable
Hi Girts,
For huge amount of records, I haven't found any effective solutions to improve calculation performance. Maybe you can try to summary them before get data to power bi.
AFAIK, current power bi not support create dynamic calculated column/table based on filter/slicer.So I'd like to suggest you use measures to instead.
In addition, please don't nested complex measures or write complex formula in condition functions.(e.g. sumx, countx...)
Optimizing DAX expressions involving multiple measures
Regards,
Xiaoxin Sheng
- appleFrequent Visitor
I have 2 measures -> Totalsales= sum(sales) , Totalpurchases = sum(purchases) ,I am calculating new measure profit = sales - purchases , will writing profit = sum(sales) - sum(purchases) or profit = Totalsales -Totalpurchases is efficient or both are same as dax while calculating measures it converts the measures referred inside a measure into text format and then it will calculate
Which among those 2 approaches will be good in terms of perfromance,
- ImkeF
Community Champion
Yes, grouping data first can be benefitial for certain calculations. I've collected some tips for performance improvements in the query editor here: https://www.thebiccountant.com/2017/05/29/performance-tip-partition-tables-crossjoins-possible-powerquery-powerbi/
- GirtsFrequent Visitor
Short additional info ...
My task becomes more complex as I need to add KPI to report, same time keeping journal entry values to drill down.
For example:
- A Turnover
- B Direct costs
- C Bruto profit = A - B
- D Bruto profit rentability in % C/A
- ... etc
Same time need to keep sums for the whole company and by costs centers as well (projects, departments).
I tried to get it in one table, but I got more than 30 modifications. Now I am trying to split results in separate tables to unite them in one report.
- ImkeF
Community Champion
Hi Girts,
in the link I've provided you'll also find a reference to this article: https://exceleratorbi.com.au/calculated-columns-vs-measures-dax/ which looks very relevant to me: Rentability % is mooost likely a case for measures (think a about the subtotals in your visualisations).