if then else
4 TopicsIF Conditions
Hi everyone! I need to add one option in IF constraction... switch off name if name in a period - data for this is in another table with colomns (Name, Start_period, End_Period) working constration: Count of -ve = SUMX ( CROSSJOIN ( VALUES ('Календарь'[Date]), VALUES ( Data[Name] ) ), IF ( [diff_AvSal_bal] < -1, 1, 0 ) ) I try to add condition in IF constraction, but it doesnt work Count of -ve = SUMX ( CROSSJOIN ( VALUES ('Календарь'[Date]), VALUES ( Data[Name] ) ), IF ( [diff_AvSal_bal] > 0 OR 'Календарь'[Date] IN DATESBETWEEN('Sheet1'['Start_per'], 'Sheet1'['End_per']'), 0, 1 ) )Solved1.4KViews0likes6CommentsRetrieve value from same row based on value in column
I am looking to build a calculated column that pulls its data from one of two other columns based on the value in a third column. Example would be: Phase Volume1 Volume2 Calculated Column 0 23 45 45 1 4 0 4 2 4 0 4 3 2 0 2 If the "Phase" column equals 0, then I want the volume in the "Volume2" column. If the "Phase" column is greater than 0, then I want the volume in the "Volume1" column. Thank you in advance.Solved1.3KViews0likes1CommentDAX Power BI Measure If Then with Numbers and Text
Good morning all, I am creating a measure and cannot put this in Power Query because it is looking at other tables. TextField1 !MergedTraining'[GAP-SH-SA-Primary.GAP SH/SA 1st contains text (an expected cell is SA) NumberField2 !MergedTraining'[GAP √ SA] contains numbers (an expect response cell be 1) TextField3 !MergedTraining'[OPER Pos] contains text (an expected response is OPER-SH-SA) Basically (in my head of not-right-thinking), I want to create an If then statement, but I am running into issues where Power BI is throwing an error that says that I can't use text and numbers together. Let's imagine that they are all in the same table "CHECK" for our purposes here. I will change that later. If TextField"1"=SA & NumberField2="1" & TextField3="OPER-SH-SA", then output "Yes", If not "No" I attempted this and it was successful: Comply-SSC-SA = IF( FIRSTNONBLANK('!MergedTraining'[GAP-SH-SA-Primary.GAP SH/SA 1st],1)="SA", "YES", "NO") I attempted to add my next field and failed with the following message: DAX comparison operations do not support comparing values of type True/False with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values. Comply-SSC-SA = IF( FIRSTNONBLANK('!MergedTraining'[GAP-SH-SA-Primary.GAP SH/SA 1st],1)="SA" & SUM('!MergedTraining'[GAP √ SA]) = 1, "YES", "NO") I think that if I can figure out TextField1 and NumberField2, I can deal with TextField3 after that (🤞) Any thoughts for this newbie? Thanks. Jamie1.6KViews0likes3CommentsNew column with IF THEN ELSE with OR & AND
Hi all - trying to fill with a new column using the following formula - shows no initial syntax errors but errors at run time: if [Status] = "A" or "INTL" or "F" and [Status Date] < 04/01/2021 then "Yes" else if [Status] = "T" and [Status Date] >= 03/01/2021 then "Yes" else "No" Any help would be greatly appreciated...1.5KViews0likes3Comments