result
4 TopicsUse previous row result as base of calculation
Hello folks ! I hope you are doing well 😁 I'm developping a tool on PBI to calculate a projected stock, i'm really blocked with the formula & DAX command. Basicly i use the month stock of my clients to calculate their needs and i do a simulation with my shipping plan. Here my draft : Basicly to calculate the projected stock i do : Projected Stock = [Stock] + [Inbound M-1] - [2024+%] [Stock] is the declared stock by the client and its blank if we don't have the data [Inbound M-1] is the entering stock to the client warehouse [2024+%] is the sell-out of my client with a % of depletion All the rows are diferents mesures coming from a data base and converted to the same unit. What I want to do is that if my [Stock] = blank(), I use the previous result of the projected stock as [Stock] to simulate the new projected stock for the next month and do it recursively. I hope you'll understand my problem and try to help me. The column "Test2" its my tentative and its working for march but not for the other months, here my code : Test 2 = if([Stock]=BLANK(), var _step1 = [Projected Stock M-1]+[Cumul inbound M-1] - [Cumul 2024 + %] var _step2 = if([Projected Stock M-1]=BLANK(),_step1+[Cumul Stock]+ [Cumul inbound M-1] - [CA 2024 + DEPLETION],_step1) return _step2,[Projected Stock]) Many thanks to all who will take the time to help a Beginner ! Best regards !376Views0likes1CommentTotal result of a measure with IF
Hello, I'm having some issues displaying the total result of a Measure with IF statment. I have this column, based on the following measure: VAL_BASE_CALC_SERV_PREST = VAR bcsp = [VAL_MAX_CONTRIB] - [VAL_BASE_OF_II] RETURN CALCULATE((IF(bcsp > [VAL_SERV_PREST],[VAL_SERV_PREST], IF(bcsp <= 0,0,(bcsp))))) The total row is showing me "0,00" but I need to show me the result of the values. I tried creating another measure to sum the values, but it give-me 0 too. Best Regards Daniel.Solved574Views0likes1CommentHow the Filter definition of the metric can affect the final result.
Let's assume that I have the Products table in my model defined like this: ProductID UnitPrice UnitsInStock Discontinued 1 10 50 TRUE 2 15 30 FALSE 3 20 20 TRUE 4 25 10 TRUE 5 5 15 FALSE I have created two metrics : Value1 = CALCULATE ( SUMX ( Products, Products[UnitPrice] * Products[UnitsInStock] ), FILTER ( Products, Products[Discontinued] = TRUE ) ) Value2 = CALCULATE ( SUMX ( Products, Products[UnitPrice] * Products[UnitsInStock] ), Products[Discontinued] = TRUE ) The only difference is the definition of the filter. I have evaluated the results in Power Desktop but I do not see any difference. This leads to my question: How could this definition affect the final result of the metric or when might this occur?Solved537Views0likes1CommentUse results from a card in a custom calculation for another card
I'm a new user of Power BI and this is my first post so hello everyone! I work for a property company and am creating a dashboard to show property values, capex and Return-on-Equity at each half year period. The user can select specific properties or the whole portfolio through various slicers. Unfortunately I can't share the data as it is commercially sensitive however it is broadly set out as follows: Property Period (in date form in my data) Attribute Value Buckingham Palace H2 2019 Valuation 100 Buckingham Palace H2 2019 CapEx spent 10 Buckingham Palace H1 2019 Valuation 90 Buckingham Palace H1 2019 CapEx spent 5 ... ... ... ... I have three cards set up as follows which depend on the selection within the slicer: Value at start - This shows the sum of all valuations on the earliest date. CapEx spent to date - This sums all capex spent in all periods. Current value - This shows the sum of all valuations in the most recent date. I want to create a fourth card which will display the profit to date: Result = Current Value - (Value at Start + CapEx spent to date) The problem is that I need it to be dynamic and adjust depending on the selection of the slicers hence why I would like to take the card results rather than calculate a new table of results. Is this possible?Solved1.3KViews0likes3Comments