Forum Discussion
IF statement acting inconsistent, no FALSE option allowed
Hi all!
I've got a problem with an if statement that I can't seem to figure out. To make things worse, microsofts own documentation isn't consistent with the behavior of my if statement.
Here is the statement:
- Anonymous6 years ago
Hi,
I also had a similar issue when I was using Direct query mode.
Try the following -
Category1CountWeek =SUMX(VALUES('VBM+Server'[Serial number]), IF(([ProductionCategoryWeek] = "0 - 50"), (1),(0)))
3 Replies
- sturlaws
Resident Rockstar
Hi Anonymous ,
I am not able to recreate your issue, this code works as expected in the small sample file I created for myself:
if_test = SUMX ( VALUES ( 'Table1'[Column1] ), IF ( ( [measure] > 5 ), 1, 0 ) )
Perhaps try to create a very simple model, and see if you are able to create your issue yourself. If you are, you could share the sample reportCheers,
Sturla - AnonymousNot applicable
Hi,
I also had a similar issue when I was using Direct query mode.
Try the following -
Category1CountWeek =SUMX(VALUES('VBM+Server'[Serial number]), IF(([ProductionCategoryWeek] = "0 - 50"), (1),(0)))- AnonymousNot applicable
Thanks a lot, that worked! I guess everything might need to be in () cause the logical statement is also in ()