f
2 TopicsDAX takes 60 seconds to load with many what if numeric parameters
Hi, I have the following dax that uses measures where i addded the user numeric parameters with our values and i want to put them in my matrix but the performance is super slow, here is the dax of the final measure. Total_Customers_2 = var AllActuals = [All Actuals] var notselected_customers = [notselected_customers] return IF( SELECTEDVALUE('SBI Actuals Agg (x100)'[Line of Items]) = "[NE]", FORMAT(CALCULATE([Nes_time_new] + notselected_customers+AllActuals), "#,##0"), IF( SELECTEDVALUE('SBI Actuals Agg (x100)'[Line of Items]) = "[L66]", FORMAT(CALCULATE([L6_time_new] + notselected_customers+AllActuals), "#,##0"), IF( SELECTEDVALUE('SBI Actuals Agg (x100)'[Line of Items]) = "[L66b]", FORMAT(CALCULATE([L6b_time_new] + notselected_customers+AllActuals), "#,##0"), IF( SELECTEDVALUE('SBI Actuals Agg (x100)'[Line of Items]) = "[C11]", FORMAT(CALCULATE([c1_time_new_] + notselected_customers+AllActuals), "#,##0"), IF( SELECTEDVALUE('SBI Actuals Agg (x100)'[Line of Items]) = "[L110]", FORMAT(CALCULATE([L10_time_new] + notselected_customers+AllActuals), "#,##0"), IF( SELECTEDVALUE('SBI Actuals Agg (x100)'[Line of Items]) IN { "[GE]", "[L66a]", "[L1]", "[L2]", "[L3]", "[Net Weight]" }, FORMAT([Fixed_Date_Total_Customers]+AllActuals, "#,##0"), IF( SELECTEDVALUE('Sorting Index'[Line]) = "C1", FORMAT([c1PerNes_total], "#0.00%"), IF( SELECTEDVALUE('SBI Actuals Agg (x100)'[Line of Items]) = "[L14]", FORMAT(CALCULATE([L14_time_new] + notselected_customers+AllActuals), "#,##0"), BLANK() ) ) ) ) ) )))485Views0likes2CommentsNested Filter Referencing Two Unrelated Tables.
Hello everyone, I am feeling absolutely beat. I have been trying to get a conditional value to populate based on if two conditions are met, which will then be used in future formulas, but apparently I am at a complete lack of understanding as to how PBI operates when it comes to evaluating expressions. I have 3 tables with Stock Data pulling form a SQL server: Stock_main - Columns (Stock ID (Primary), Ticker, Company_name, stock_index) Owned - Columns (Purchase ID, Stock ID (Foreign), Buy_Date, Shares, Cost, Portfolio) Price - Columns (Stock ID (Foreign), Date_stamp, Open, High, Low, Close, Volume) What I want is to determine if I have owned a specific stock on that date. I have been trying methods with IF statements and FILTER statements to iterate through each row of the "Price" table to look at the stock ID, match it with a Stock ID from the "Owned" table, then determine if the Date_stamp in the price table is greater than (after) the date i bought it by referencing the "Buy_Date" column in the "Owned" table. This is one that that works at a hit rate of about 80% of the time. Owned at Date Conditional = IF( AND (FIRSTDATE('price'[Date_stamp])>= FIRSTDATE( FILTER( FILTERS('owned'[buy_date]), FIRSTNONBLANK('owned'[stock_id],"")=FIRSTNONBLANK('price'[stock_id],"") ) ), FIRSTNONBLANK('price'[stock_id],"") IN DISTINCT('owned'[stock_id]) ), TRUE(), FALSE()) Like I said, the above formula results in a TRUE or FALSE correctly about 80% of the time. Please help. There has to be an easier way to do this but I'm just so wrapped up in this incorrect method that I am stuck running in circles. Cheers,Solved1.5KViews0likes3Comments