if functions
9 TopicsIf null, then use other columns values (Easy IF statement maybe?)
Hi All, I have a table like so... Order Date Date Secured 11/11/2022 null 12/11/2022 null null 14/11/2022 null 15/11/2022 13/11/2022 null I would like this result.... Order Date Date Secured Close Date 11/11/2022 null 11/11/2022 12/11/2022 null 12/11/2022 null 14/11/2022 14/11/2022 null 15/11/2022 15/11/2022 13/11/2022 null 13/11/2022 Many Thanks all I will accept your solution if correct tomorow morning! TaylorSolved2.5KViews0likes2CommentsDAX measure with multiple IFs
Hello, Please can you help me to write this DAX measure in Power BI? I have 5 columns with multiple combinations (A - E) and F column which summarize the columns A - E. I need to obtain the result from column "RESULT" and I don't know what formula should I use. Thank you for your support.Solved683Views0likes2CommentsIF/SWITCH measure performance
Hi, I have a general question about the best way to write if/switch measures. Is any of the following examples (1 and 2) more efficient than the other? 1) if_measure = IF(condition_measure = value1, [measure1], [measure2]) switch_measure = SWITCH(condition_measure, value1, [measure1], value2, [measure2], [measure3]) 2) if_measure = IF(condition_measure = value1, DAX code for measure 1, DAX code for measure 2) switch_measure = SWITCH(condition_measure, value1, DAX code for measure 1, value2, DAX code for measure 2, DAX code for measure 3) Thanks!472Views0likes1CommentDAX measure or calculated column Logic help
Hello! I have a matrix set up as the figure below Basically the hierarchy of rows is NAME > GROUP > SECTION The grouping was done automatically in powerBI matrix.. When you expand a GROUP within a NAME you will get the following breakdown along with the column1 values as shown I want to create a measure or a calculated column that is conditional based on the values of column1 within each GROUP.. So if a GROUPhas atleast one value that says BLUE, then the result would return TRUE for all the SECTIONS within that group, and if none of the columns have BLUE, then return FALSE as shown below I have been trying for a while now, any help is appreciated!Solved893Views0likes3CommentsDAX: lookupvalue takes first previous date value
Hi! Need help! If someone can solve it I would be very greatful! I have 2 tables. Table one: Has customer_id, session, session_date, session_group. Table two: Has customer_id_, invoice_sum, invoice_date. I need DAX that looks up value in table two when session_group = "4" and takes invoice_sum value to table one. Also I need conditions that customer_id in table 1 = customer_id in table 2. Tricky part is that session_date and invoice_date dont match always and mostly session date is after invoice date. So I need also a condition that looks up first invoice_sum that is before session_date (starting form session_date). Thank you in advance!Solved621Views0likes2CommentsCalculate x+1 if x
I'm fairly new to DAX so apologies if this is a stupid question. I have spent what feels like ages searching though! I have a table with multiple variables (work types) and I need to increase the count of one variable by the total number of another variable. So for every 1 HIHSYS, I need to increase the total for HIHGAS (and the overall total) by 1. Hope that makes sense. I don't want to group it as I don't want to group other variables. Is there a way of doing this using DAX? I've tried CALCULATE but as they're both in the same column it doesn't like it. I've recreated the table below with dummy data. Workstream 1/4/22 1/5/22 1/6/22 1/7/22 1/8/22 HIHSYS 4 23 1 8 2 HIGAS 3 16 3 9 12 HIGASSYS HIHABC 23 8 8 4 9 HIHBCD 6 2 14 3 7 HIHCDE 2 0 3 5 4 TOTAL 38 49 29 29 34563Views0likes2CommentsFetch Value of a column from 2nd table depending on condition from 1st table
Hi All, I want to fetch the value of Date from TAB2 depending on the *Condition(listed below) from the TAB1. TAB1 Company Key field Invoice number Doc number ABCX 15 123456 123456 ABCX 1 123456 1245987 TAB2 Company Invoice number Date ABCX 123456 01-01-2000 10:00 ABCX 123456 02-01-2000 10:00 The condition is fetch the value of the date field from TAB2 for the same invoice number present in TAB1 only if the Key field value is "15" for the same invoice number in TAB1 This is what i have written but it says memory error. Any idea where I am going wrong? Pay Date = if('TAB1'[Invoice Number] == 'TAB1'[Doc Number],if('TAB1'[key field] = "15",LOOKUPVALUE('TAB2'[Date],'TAB2'[Invoice Number],'TAB1'[Doc Number]))) I have created a new column and have applied the query to the same column Thanks in Advance. amitchandak2.1KViews0likes12CommentsNeed Help on DAX - SWITH / IF Function results incorrect
Comparing two measures [Ref CY], [Ref PY] and deriving a custom tag for each record. The calculation below works well for some scenarios but incorrectly calculates if it meets "ELSE" condition records. Any suggestion would be much appreciated. Priority = IF ( AND ( [Ref CY]=0,[Ref PY]=0),"C", IF ( AND ([Ref CY]=0,[Ref PY]>=1),"b", "B") ) Priority Alt = SWITCH ( TRUE, (([Ref CY]=0) && ([Ref PY]=0)), "C", (([Ref CY]=0) && ([Ref PY]>=1)), "b", "B" ) The calculation works well But it is incorrect if any record meets on ELSE conditionSolved477Views0likes2Comments