conditions
7 TopicsDirect query - add values from other table to the main table with conditions
Hi, I have created model in "direct query" mode, I dont have experience with it. (I normaly use add Column with combination formulas Calculate + Allexept... now it doesnt work) I need to add values from one column in "table B" to the "table A" for Column xID. I have this conditions: max values from "Column Order" -1 for each Column xID determine value in Column Personal ID in Table A, which is key for connect to Table B. The unique key for this situation in Table A is combination Column xID with Column Personal ID (because values from Personal xID can be repeated). I need to add value from Table B - Column Name to the new Column in Table A (in need can by measure), duplicated for same Column xID values. (Table A has over 23 milions rows)821Views0likes3CommentsDAX formula IF measure returns null value then search ID and match with another table ID
I need Expert support on below query. I've made below table using existing datasets and measures, which gives me SW_PART value against each of opportunity using multiple criteria. Now, I want next level DAX calculation to merge/show single row which is first row, the calculation should give me second row result into First row, I mean value 5720 (under OPP-10225) -should be visible/copy to OPP-10236 and later I will hide the OPP-10225 from the table visual. SW_PART is already a measure Opportunity ID Opportunity Name End Customer Name SW_PART OPP-10236 VD OPS_Support Apple OPP-10225 VD OPS Apple 5720 OPP-10237 MD OPS_Support MS OPP-10226 MD OPS MS 8890 OPP-10238 DD OPS_Support Virgin OPP-10227 DD OPS Virgin 23345 To identify the correct opportunity ID, I've made below excel table, which I've already imported to PowerBI. This table help to identify the which NULL Opportunity ID from above table matches Original OPP_ID to this table then search Product OPP_ID = Opportunity ID and get the value or calculate value then return the value against Opportunity ID Original Opp_ID Product OPP_ID Product Quote _PK Quote ID OPP-10236 OPP-10225 TST-024693 7D1E2089-3CF9-ED11-8F6E-6045BD11F57A OPP-10108 OPP-10425 TST-025442 BFB78603-F7B8-ED11-B596-00224801E567 I've used below DAX but it's showing same values in against all NULL opportunities SW_PART_Filled = VAR ValuefromOPP_ID = CALCULATE( [SW_PART], FILTER( ALL('Quote Details - All Records'), 'Quote Details - All Records'[_FK Quote ID] = MAX('VN-OPP Identifier'[_PK Quote ID]) ) ) RETURN IF( ISBLANK([SW_PART]), ValuefromOPP_ID, [SW_PART] ) Results I am getting as below, which showing same results against opportunity Opportunity ID Opportunity Name End Customer Name SW_PART OPP-10236 VD OPS_Support Apple 5720 OPP-10225 VD OPS Apple 5720 OPP-10237 MD OPS_Support MS 5720 OPP-10226 MD OPS MS 8890 OPP-10238 DD OPS_Support Virgin 5720 OPP-10227 DD OPS Virgin 23345Solved934Views0likes3CommentsHow to replicate Parameters (tableau) in Power BI?
This is the parameter created in Tableau and I want to create something similar in Power BI, as this parameter is then used to calculate a field called PLAN as below: What is the best way I can achieve this in Power BI? I want to use this field "Plan" (sum) as my column value.Solved2KViews0likes2CommentsHow to Compare to set a condition for two records that must meet a condition for 2 different years?
I am working on a data set where we have a list similar to this id, name, year,earned_savings A1006, aliance 1, 2021, 0 A1006, aliance 1, 2022, 8,934.253 I'm using the following code NoMoneyBothYears2 = IF( SUMX( FILTER('public mssp_2021_2022_aco', 'public mssp_2021_2022_aco'[year] = 2021 && 'public mssp_2021_2022_aco'[earnsaveloss] <= 0), 1 ) > 0 && SUMX( FILTER('public mssp_2021_2022_aco', 'public mssp_2021_2022_aco'[year] = 2022 && 'public mssp_2021_2022_aco'[earnsaveloss] <= 0), 1 ) > 0, "Lost money both years", BLANK()) However, it seems to still flag each record. I would like it to flag only if both lost money on both years, but the script above doesn't seem to be working.Solved482Views0likes1CommentConditional Calculation Based on Category
Hi all, I have quite complicated logic that I need to apply. In his scenario, I have table Brand with their revenue amount. I need to re-allocate "Default" to brand where revenue > 0, except for D. Brand D is automatically excluded from reallocation no matter if its revenue >0. For example: Brand Amount A 3000 B -2000 C 8000 D 2000 Default -1000 In this case, I need to allocate Default(-1000) to Brand A and C only. How do I do the condition based on logic stated? Please help:(Solved2.5KViews0likes4CommentsCumulative sum measure filtered by conditions on two diferente tables
Hi guys, Need a bit of a help here with a dax measure. For context, here's a printscreen of my current data model. If I want to calculate the stock value in a given period I can use the following measure: Stock = CALCULATE( SUM(MaterialMovimento[Quantidade]); FILTER(ALL(Datas[Data]); Datas[Data] <= MAX(Datas[Data])) ) But the problem starts when I want to calculate the stock value in given period of time, but just for materials which are slow movers. In other words, materials that don't have any sale in the past 3 months for any given date. I've tried to create a measure to plot the stock value of slow movers over time but it's just not working. Here's the dax measure I'm unsuccesfully working on: SlowMoversStock = VAR SlowMovers = CALCULATETABLE(Material; FILTER(ALL(ClienteFaturacao); ClienteFaturacao[DataCriacao] <= DATEADD(Datas[Data]; -3; MONTH))) Return CALCULATE( SUM(MaterialMovimento[Quantidade]); FILTER(ALL(Datas[Data]); Datas[Data] <= MAX(Datas[Data])); INTERSECT(Material; SlowMovers) ) Unfortunatelly, with this measure I'm not able to get any value. All the graphics shown below were ploted with yaxis = SlowMoversStock and xaxis = Datas[Data] I think the problem it's somehow related with the date filtering (probably because of the relationships on the data model) I'm trying to perform when creating the calculated table to get the materials which are slow movers. You can see that I filter with a fixed date, the graphic shows values, as you can see in the code and image below. SlowMoversStock = VAR SlowMovers = CALCULATETABLE(Material; FILTER(ALL(ClienteFaturacao); ClienteFaturacao[DataCriacao] <= DATE(2019; 7; 7))) Return CALCULATE( SUM(MaterialMovimento[Quantidade]); FILTER(ALL(Datas[Data]); Datas[Data] <= MAX(Datas[Data])); INTERSECT(Material; SlowMovers) ) Any help would be appreciated. Thanks in advance!1.3KViews0likes2CommentsDataViewMapping Conditions Not Working as Expected
I'm having some trouble with setting up a condition containing a minimum requirement. Example: "conditions": [ { "x": { "max": 1 }, "y": { "min": 2 } } ], The goal is that until the user has mapped exactly one X and two or more Y fields, they will continue to see an error like this: What actually happens is that you can't map any fields at all. We could set up multiple conditions as "stepping stones" to get to the condition shown above, but that would completely defeat the purpose. The goal here is to display the included error message until the user has mapped all the necessary fields. Is this possible, or will we need to implement our own input validation and error display? powerbi-visuals-api: 2.5.0 powerbi-visuals-tools: 3.0.12 powerbi-visuals-utils-dataviewutils: 2.1.1