performance
28 TopicsDax Query Consumed Memory 1063 MB,exceeded
Hi Guys, in power bi desktop I got en error : Visual has exceeded available resources I have run Performance Analyser and after running dax queries I got: Resolve the error to see results Resource Governing: This query uses more memory than the configured limit. The query — or calculations referenced by it — might be too memory-intensive to run. Either reach out to your Analysis Services server administrator to increase the per-query memory limit or optimize the query so it consumes less memory. More details: consumed memory 1063 MB, memory limit 1024 MB. I have used Run in Dax query view. This is my code: DEFINE VAR __DS0FilterTable = FILTER( KEEPFILTERS(VALUES('Dim_Date'[Date])), AND('Dim_Date'[Date] >= DATE(2025, 4, 1), 'Dim_Date'[Date] < DATE(2025, 5, 1)) ) VAR __DS0Core = SUMMARIZECOLUMNS( ROLLUPADDISSUBTOTAL( ROLLUPGROUP( 'Dim_EA_SavingPlans'[CommitmentAmountPerDay], 'Dim_EA_AmortizedCosts_DiscountPlans'[PricingModel], 'Dim_EA_AmortizedCosts_DiscountPlans'[ResourceLocationNormalized], 'Dim_EA_AmortizedCosts_DiscountPlans'[OfferId], 'Fct_EA_AmortizedCosts'[CostInBillingCurrency] ), "IsGrandTotalRowTotal" ), __DS0FilterTable, "Wastage_Amount", 'MeasureTable'[Wastage Amount], "Commitment_Amount_Per_Day_With_OnDemand", 'MeasureTable'[Commitment Amount Per Day With OnDemand], "Percent_Commitment_Day_Has_PricingModel", 'MeasureTable'[Percent Commitment Day Has PricingModel], "Wastage___in_Total_Has_Pricing_Model", 'MeasureTable'[Wastage % in Total Has Pricing Model], "Sum_of_Amortized_Cost__TREATAS_", 'MeasureTable'[Sum of Amortized Cost (TREATAS)] ) VAR __DS0PrimaryWindowed = TOPN( 502, __DS0Core, [IsGrandTotalRowTotal], 0, 'Fct_EA_AmortizedCosts'[CostInBillingCurrency], 1, 'Dim_EA_SavingPlans'[CommitmentAmountPerDay], 1, 'Dim_EA_AmortizedCosts_DiscountPlans'[PricingModel], 1, 'Dim_EA_AmortizedCosts_DiscountPlans'[ResourceLocationNormalized], 1, 'Dim_EA_AmortizedCosts_DiscountPlans'[OfferId], 1 ) EVALUATE __DS0PrimaryWindowed ORDER BY [IsGrandTotalRowTotal] DESC, 'Fct_EA_AmortizedCosts'[CostInBillingCurrency], 'Dim_EA_SavingPlans'[CommitmentAmountPerDay], 'Dim_EA_AmortizedCosts_DiscountPlans'[PricingModel], 'Dim_EA_AmortizedCosts_DiscountPlans'[ResourceLocationNormalized], 'Dim_EA_AmortizedCosts_DiscountPlans'[OfferId] Can anybody advice what is wrong with my query? Best, JacekSolved873Views0likes3CommentsPerformance Issues with Embedded Power BI Dashboards
I have embedded multiple Power BI dashboards on my website. However, when multiple end users try to access the dashboards simultaneously, they experience significant delays in loading. I have verified that the dashboard performance is generally fast, and I have implemented incremental refresh, RLS methods, and have only 4 to 5 visuals with several filters. I am using Pro licenses.1.3KViews0likes4CommentsDax performance of calculatetable vs filter with multiple conditions
Hi, I thought calculatetable would provide better performace over the use of filter to create a filtered table (in a variable) when using multiple filter conditions. However, I am seeing the opposite (and it is very significant) Can someone please help me understand why calculatetable is significantly slower? Here is my measure: I have commented out the alternative (that is faster) for "var b" Attribute List = var a = VALUES(‘Table’[ID]) //This list is obtained when a user clicks on another visual aggregated by another column var b = CALCULATETABLE( SUMMARIZE(‘Table’, ‘Table’[ID], ‘Table’[Attribute]), ‘Table’[ID] in a ,’Table’[Attribute] <> "Count" ) // var b = FILTER(SUMMARIZECOLUMNS( ‘Table’[ID], ‘Table’[Attribute], // FILTER(‘Table’, ‘Table’[ID] in a && ‘Table’[Attribute] <> "Count") // ), TRUE() // ) var c = CONCATENATEX(b,’Table’[Attribute]," , ") RETURN IF(ISINSCOPE(‘Table’[ID]),c) To keep it simple, here is a small sample of my data: (my actual data is not that big (about 500k rows), but has more columns than below - I have only given relavant columns) ID Attribute A Count A Excel A Word A Access A PowerPoint B Count B Access B PowerPoint C Count C Word D Count D Excel D Word D PowerPointSolved1.6KViews0likes3CommentsQuery optimization assistance
Hello, I am trying to see if there is a way to optimize the measure in the sample attachment. The model details an asset (automobile) with events (EventFacts) on a given date. Each automobile may or may not be associated with a configuration (AssetEventMapping). What I would like is a distinct count of assets by day (see DateTable) only if the asset has a configuration associate in the AssetEventMapping table. The model details below show example tables & records with the desired result. As can be seen, assets 6 and 7 do not show up in daily count because they do not contain a record in the mapping table (filtered out via the "in distinct" portion of hte measure). This measure works fine with small dataset, but my real dataset contains millions of records and this query is taking ~5 seconds. Thanks Tables: Measure: Count of Assets Reporting = calculate( DISTINCTCOUNT(EventFacts[AssetId]), FILTER( EventFacts, EventFacts[AssetID] in (distinct(AssetEventMapping[AssetID])) ) )Solved1.8KViews0likes2CommentsCalculation group performance issue
Hello everyone, I face an issue about performance when I use calculation groups in my model. To give some context items, my dataset is quite complex (around 40 tables) and is stored on a premium capacity P2. It's a composite model that is using the user defined agregation feature of Power BI so we manage a detailed fact table and an aggregated one. To simplify my case, please consider the example below : - I have one measure "Amount" (sum of my fact table) - I have one measure "Amount Last Year" - I have a calculation group with one item that calculate Last Year value for the selected KPI - Then, I create two matrix on my report : - One is using the measure "Amount Last Year" to display last year amount per fiscal period - One is using the measure "Amount" on which I apply the calculation item "Last Year" to display last year amount per fiscal period When I compare the performance of the two visuals, I face a very big gap in term of performance. This example is a lot more simplified than the visual i'm creating for my reporting purpose. In real situation, visuals are taking to much time when I use calculation groups so it's not possible to use them. Does someone have any idea about where this performance gap could come from ? Thanks, R_LB768Views0likes2CommentsThe most efficient way to perform lookup in table
Hello guys, how are you? I'm having a very specific issue, and even knowing how to solve that in theory, I'm having serious performance problems, due to the obligatory use from a very heavy database - an azure cube developed by my company that provides data worldwide. I've come with an example in a fact table, where I have trips from loading vehicles with an initial weight in the beggining of the trip. I need to create a measurement (can't make new columns in the direct query) that calculates the initial weight for the next trip from this same vehicle. It's a very simple task with ALL filters and on, however the real table is not retrieving the data due to the mentioned size of the datamodel. I've been trying using the OFFSET funcion, but I'm not being able to make the logic work to my problem. Any suggestions? Below, the latest try I've made: Next trip weight = VAR vFrota = MAX('Shifts and Events'[VehicleUsedId]) VAR vData = MAX('Shifts and Events'[EventStartDateTime]) VAR vTab = FILTER( ALL('Shifts and Events'), 'Shifts and Events'[EventStartDateTime] > vData && 'Shifts and Events'[VehicleUsedId] = vFrota ) VAR vMenorData = CALCULATE( MIN('Shifts and Events'[EventStartDateTime]), vTab ) RETURN CALCULATE( MAX('Shifts and Events'[MeasureBeforeLoading(kg)]), FILTER( vTab, [EventStartDateTime] = vMenorData && [VehicleUsedId] = vFrota ) ) Below an example of how I'm trying to make the information appear: Thanks!Solved1.3KViews0likes2CommentsMultiple KPI Calculations over a KPI Table - options for fast performance
Hello! I have to calculate multiple KPI's based on a KPI table that relates to a transactional table with amounts (over 800k recods, with AC FC PL PY switch, and MTD/YTD and Currency Switches). Basically each KPI refers to a group of transactions, at the same tome they can have various calculations conditions (eg. filtering other dimensions). I tried various options but not able to get the performance i would expect. Right now the best option is to use SUMX over the KPI table and SWITCH on each encounter of a KPI and apply the formula. The KPI formulas are calculations between the KPI's themself (eg DIVIDE(KPI_A,KPI_C). Is there a better way to approach this situation and have a better DAX logic for the measure(s) that will also provide fast percormance? I tried with multiple calculate and switch measures, but performance is worse. Current performance of measure using a matrix visual in PowerBI (query extracted and runed in DAX Studio): Below current measure I use: MEASURE ' Measures'[__mCalculateKPIGroups] = VAR __vReturn = SUMX ( //Filter KPI table for Management P&L Hierarchies FILTER('KPI Groups',SELECTEDVALUE ('KPI Groups'[LEV1_Name]) = "AAA" || SELECTEDVALUE ('KPI Groups'[LEV2_Name])="BBB"), //Get row context VAR __vKPI_ID = 'KPI Groups'[KPIGroup_SID] VAR __vKPI_LEV3_NAME = 'KPI Groups'[LEV3_Name] VAR __vKPI_LEV2_NAME = 'KPI Groups'[LEV2_Name] VAR __vKPI_LEV1_NAME = 'KPI Groups'[LEV1_Name] //Get additional attributes VAR __vGetTimePeriod = SELECTEDVALUE ( 'Time Period Selector'[Period]) VAR __vGetKPI_Formula = LASTNONBLANK(SELECTCOLUMNS(RELATEDTABLE('KPI Groups Details'),"Formula",[Formula]),TRUE()) VAR __vGetDataType = SELECTEDVALUE('Data Type'[Data Type]) //Filtering conditions VAR __vFilterCondCATDefault = {"a","b","c"} VAR __vFilterCondCATINPL = "z" VAR __vFilterCondCATINAC = "x" VAR __vFilterCondCATFT_PL = "y" VAR __vFilterIA = FILTER(VALUES('ID'[DEP]),NOT('ID'[DEP]=BLANK())) VAR __vFilterID = FILTER(VALUES('ID'[DEP]),'ID'[DEP]=BLANK()) VAR __vFilterOU = FILTER(VALUES('OA'[NAME]),NOT([NAME] IN {BLANK(),"INF"})) VAR __vFilterCATDefault = FILTER(VALUES('Category'[Category]),[Category] IN __vFilterCondCATDefault) VAR __vFilterCATINPL = FILTER(VALUES('Category'[Category]),[Category] = __vFilterCondCATINPL) VAR __vFilterCATINAC = FILTER(VALUES('Category'[Category]),[Category] = __vFilterCondCATINAC) VAR __vFilterCATFT_PL = FILTER(VALUES('Category'[Category]),[Category] = __vFilterCondCATFT_PL) VAR __vFilterACCFT_MTD = FILTER(VALUES('ACC'[ACC]),NOT(CONTAINSSTRING('ACC'[ACC],"AVG"))) VAR __vFilterACCFT_YTD = FILTER(VALUES('ACC'[ACC]), CONTAINSSTRING('ACC'[ACC],"AVG")) //Calculate KPI Groups VAR __vCalculateIN_AC = CALCULATE ([__mSwitchSign],__vFilterCATINAC,__vFilterIN) VAR __vCalculateIN_PL = CALCULATE ([__mSwitchSign],__vFilterCATINPL,__vFilterIN) VAR __vCalculateIN = IF(__vGetDataType IN {"PL"},__vCalculateIN_PL,__vCalculateIN_AC) VAR __vCalculateFT_MTD = CALCULATE(-[__mSwitchSign],__vFilterACCFT_MTD,__vFilterCATDefault ) VAR __vCalculateFT_YTD = CALCULATE(-[__mSwitchSign],__vFilterACCFT_YTD,__vFilterCATDefault) VAR __vCalculateFT = IF(__vGetTimePeriod = "MTD",__vCalculateFT_MTD,__vCalculateFT_YTD) //Switch Conditions for KPI Groups VAR __vSwitchOnINGroups_MN = __vKPI_LEV1_NAME="AAA" && __vKPI_LEV2_NAME="CCCCC" && __vGetDataType IN {"AC","PL"} VAR __vSwitchOnINGroups_TG = __vKPI_LEV1_NAME="AA" && __vKPI_LEV2_NAME="BBB" && AND(__vKPI_ID>=380,__vKPI_ID<=398) && __vGetDataType IN {"AC","PL"} VAR __vSwitchOnFT = CONTAINSSTRING(__vKPI_LEV3_NAME,"FT") VAR __vSwitchOnFT_IN = CONTAINSSTRING(__vKPI_LEV3_NAME,"FT*AD") || CONTAINSSTRING(__vKPI_LEV3_NAME,"FT*INT") VAR __vSwitchOnSignChange = CONTAINSSTRING(__vGetKPI_Formula,"-*{C,") && NOT(CONTAINSSTRING(__vGetKPI_Formula,"+")) && LEFT(__vGetKPI_Formula,1)="-" //Switch Conditions for KPI Formulas VAR __vSwitchOn_NRPS = __vKPI_LEV3_NAME="Net Revenue Professional Services" VAR __vSwitchOn_SoftNR = __vKPI_LEV3_NAME="Software NR of Total NR" VAR __vSwitchOn_ProdRATE = __vKPI_LEV3_NAME="Production Rate" VAR __vSwitchOn_UtilRATE = __vKPI_LEV3_NAME="Utilization Rate" VAR __vSwitchOn_NRPH = __vKPI_LEV3_NAME="Net Rate per Hour" VAR __vSwitchOn_SalCFS = __vKPI_LEV3_NAME="Salary of CFS FT p.m." VAR __vSwitchOn_EBIT_Margin = __vKPI_LEV3_NAME="EBIT margin % (pre investments)" VAR __vSwitchOn_EBITImpact = __vKPI_LEV3_NAME="Investments (EBIT impact)" VAR __vSwitchOn_EBITinv = __vKPI_LEV3_NAME="EBIT incl. Investments" //Calculate KPI's // [Net Revenue Professional Services] = [Net Revenues] - [Net Revenue Licenses, Revenue Licenses] - [Net Revenue Recurring Software, Revenue Recurring Software] - [Net Revenue Managed Services, Revenue Managed Services] VAR __vCalculateKPI_NRPS = CALCULATE([__mSwitchSign], REMOVEFILTERS('KPI Groups'),__vFilterIndustry,__vFilterOU,'KPI Groups'[LEV3_Name] = "Net Revenues") - CALCULATE([__mSwitchSign], REMOVEFILTERS('KPI Groups'),__vFilterIndustry,__vFilterOU, 'KPI Groups'[LEV3_Name] = "Net Revenue Licenses, Revenue Licenses") - CALCULATE([__mSwitchSign], REMOVEFILTERS('KPI Groups'),__vFilterIndustry,__vFilterOU, 'KPI Groups'[LEV3_Name] = "Net Revenue Recurring Software, Revenue Recurring Software") - CALCULATE([__mSwitchSign], REMOVEFILTERS('KPI Groups'),__vFilterIndustry,__vFilterOU, 'KPI Groups'[LEV3_Name] = "Net Revenue Managed Services, Revenue Managed Services") // [Production Rate] = [Net Available Hours - Professionals] / [Available Hours] VAR __vCalculateKPI_ProdRATE = DIVIDE(CALCULATE(-[__mSwitchSign], REMOVEFILTERS('KPI Groups'),__vFilterIndustry,__vFilterOU,'KPI Groups'[LEV3_Name] = "Net Available Hours - Professionals") , CALCULATE(-[__mSwitchSign], REMOVEFILTERS('KPI Groups'),__vFilterIndustry,__vFilterOU,'KPI Groups'[LEV3_Name] = "Available Hours")) // [Utilization Rate] = [Total Chargeable Hours] / [Net Available Hours - Professionals] VAR __vCalculateKPI_UtilRATE = DIVIDE(CALCULATE([__mSwitchSign], REMOVEFILTERS('KPI Groups'),__vFilterIndustry,__vFilterOU,'KPI Groups'[LEV3_Name] = "Total Chargeable Hours") , CALCULATE([__mSwitchSign], REMOVEFILTERS('KPI Groups'),__vFilterIndustry,__vFilterOU,'KPI Groups'[LEV3_Name] = "Net Available Hours - Professionals")) //Default calculation VAR __vCalculateDefault = CALCULATE([__mSwitchSign],__vFilterIndustry,__vFilterOU,__vFilterCATDefault) RETURN SWITCH(TRUE(), // Switch for IN Calculation __vSwitchOnINGroups_MN ,__vCalculateIN, __vSwitchOnINGroups_TG ,__vCalculateIN, // Switch for FT Calculation __vSwitchOnFT ,__vCalculateFT, // Switch for KPI Formulas Calculation __vSwitchOn_NRPS ,__vCalculateKPI_NRPS, __vSwitchOn_ProdRATE ,__vCalculateKPI_ProdRATE, __vSwitchOn_UtilRATE ,__vCalculateKPI_UtilRATE, __vSwitchOn_NRPH ,__vCalculateKPI_NRPH, // Change sign for special KPI's __vSwitchOnSignChange ,-__vCalculateDefault, // If no other conditions then return default calculation __vCalculateDefault ) ) RETURN SWITCH ( TRUE (), // Remove calc for levels 1 and 2 ISINSCOPE ( 'KPI Groups'[LEV3_Name] ) || ISFILTERED ( 'KPI Groups'[LEV3_Name] ), __vReturn, ISINSCOPE ( 'KPI Groups'[LEV2_Name] ) , BLANK(), ISINSCOPE ( 'KPI Groups'[LEV1_Name] ) , BLANK(), BLANK() )825Views0likes1CommentBest Practices for Complex Date Filters
[I apologize as I believe I posted this first under the wrong forum - deleted that post and reposting here] Hi everyone, I'm working with a model that has a large table of contracts (100s of thousands) with several date columns such as (creation_date, application_date, effective_date, expiration_date, cancellation_date, etc.) The table also has columns for contract_id and customer_id. The model uses a disconnected calendar table to produce the report visuals. This calendar table has columns for the report type (e.g. Monthly, Quarterly, or Annual), and corresponding calendar periods and period end dates. It has a little more columns and optiosn than this, but to give you an idea of how it works, this is what it generally looks like. report_type calendar_period start_date end_date Monthly Jan-2017 01/01/2017 31/01/2017 Monthly ... ... ... Monthly Aug-2022 01/08/2022 31/08/2022 Quarterly Q1-2017 01/01/2017 31/03/2017 Quarterly ... ... ... Quarterly Q3-2022 01/07/2022 30/09/2022 Annual 2017 01/01/2017 12/31/2017 Annual ... ... ... Annual 2022 01/01/2022 12/31/2022 The result is that a lot of the measures in the model end up following the same structure: MEASURE 'Some Measures Table'[Measure 1] = VAR period_start = MIN ( 'ReportingCalendar'[start_date] ) VAR period_end = MAX ( 'ReportingCalendar'[end_date] ) RETURN CALCULATE ( [Some Base Measure], // Some additional filters KEEPFILTERS ( contracts_table[contract_status] <> "QUOTE" ), KEEPFILTERS ( contracts_table[_is_original] ), // Some date based filters KEEPFILTERS ( contracts_table[application_date] <= period_end ) ) The above works really well in terms of making the DAX code modular and reducing the duplicaiton of code, but I found that the date filters are increasing the time it takes to calculate measures by 4x or more, and this impact is being propagated throughout my report as the business logic is such that date filters get used everywhere and in increasingly complex ways. For example, here's an example of a complex higher level measure: MEASURE 'Some Measures Table'[Complex Measure] = VAR period_start = MIN ( 'ReportingCalendar'[start_date] ) VAR period_end = MAX ( 'ReportingCalendar'[end_date] ) RETURN CALCULATE ( [Base Measure], KEEPFILTERS(product_dimension[type] = "x"), KEEPFILTERS( contracts_table[application_date] >= period_start && contracts_table[application_date] <= period_end ), KEEPFILTERS(contracts_table[expiry_date] > period_start || ISBLANK([expiry_date])), KEEPFILTERS( contracts_table[contract_status] <> "CANCEL" || contracts_table[cancellation_date] > period_end ) ) As you can see, I'm having to use three separate date columns to calculate this measure. In this case I'm looking to calculate the base measure for contracts that were applied for in the calendar period and were still in effect by the end of the period (i.e. were not cancelled or did not expire before the end of the period). The base measure here can be a sum of contract values, or a count of contracts, or a unique count of customers. All of these are use cases in the report. The net result of this is that some visuals in the report are taking anywhere between 3-4 minutes to load!!! I thought of creating a static aggregation table that pre-calculates these measures for all sorts of dimensions I need to filter by in the report (e.g. geography, calendar periods, products, etc.), but the challenge is that some of the measures are for customers and require doing count of unique customer IDs, which always requires going back to the actual contracts table. I'm wondering if there are best practices that I'm missing to deal with situations like this that could result in significant performance improvement. If anyone has any ideas, that would greatly be appreciated.Solved837Views0likes3CommentsPBIRS January 2021 Issues
This is related to the PBIRS January 2021 version: 1.10.7737.32652 (Build 15.0.1105.230), Released: March 12, 2021, upgrade from May 2020. 1- Performance problems. Much slower than May 2020 version. Existing reports developed with older desktop versions are very slow to run, we can see in the log the model keeps being loaded into the embedded AS many times and that slows down the performance significantly. Reports opened up in the January 2021 PBIRS Desktop version and saved perform normally. 2- Defualt Roles are somehow coruppted. Publisher role cannot manage reports saved after upgrade if developed by older desktop version. Publisher role cannot even view reports developed by January 2021 PBIRS Desktop version. Similar issue in another thread here: Power BI Report Server Jan 2021 Commenting permiss... - Microsoft Power BI Community Anyone else has encountered these issues?Solved3.8KViews0likes9Comments