Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am sharing my Pbix file here.
I am trying to have multiple IF statements under Retrurn statement.
I was able to possibly have up to 2 options, when I got to 3 options, I am not sure I am doing it right with || (or) statements.
The measure is called "Refused 0817_A" in the file.
Basically, the logic is:
If any of 3 conditions is met (OR), the output should be 0, otherwise, output should be vRefused.
I am not sure whether applying SWITCH() works under statement like this where we put under RETURN.
That is the main reason that I am trying to clarify as well.
Thanks.
@Tanushree_Kapse Thanks for help.
Don't we have to put && or || between lines?
Also, when you mentioned "measure", do you mean, put your suggested code in a separate measure and insert the measure inside the original code? Thanks.
Hi @JustinDoh1 ,
We are putting OR and AND statements instead of them.
Also, put this statements in your Return part of your existing measure.
Thanks
@Tanushree_Kapse Thank you very much for prompt reply. I just pasted the code under RETURN (before indenting), but getting "Too many arguments were passed to the ADN function. The maximum arguent count for the function is 2" error. Where am I mssing? Thank you.
This is screenshot after I tried to break down your code into 4 parts..
Are we mssing ( and one IF statement?
@Tanushree_Kapse I decided to try SWITCH, and actaully it worked magically.
Sorry, the table name is different as I was using Production table here.
Hi @JustinDoh1 ,
There's error in syntax.. brackets.
Try this, see if this helps.
IF(OR(OR(AND(AND (min(Table1[step])= 1,NOT (min(Table1[Consent])= "Refused")), min(Table1[Consentdate])<> blank()), IF(AND(AND (max(Table1[step])= 2 ,NOT (max(Table1[Consent])= "Refused")), max(Table1[Consentdate])<> blank()), AND(AND (min(Table1[step])= 1,NOT (min(Table1[Consent])= "Refused"), min(Table1[Consentdate])<> blank())), IF(AND(AND (min(Table1[step])= 1,NOT (min(Table1[Consent])= "Refused")), vimmunization < vconsent)), 0, vrefused)
AND takes two arguments, so does OR...put the brackets accordingly.
@Tanushree_Kapse Thank you so much for your reply. Sorry. I am still struggling.
Also, there are three options under IF --> 0 and then Otherwise --> vRefused.
It appears that we have four.
@Tanushree_Kapse Thanks for quick reply. While I am still trying to put your code so that there is no error message, I have a quick question. So, in DAX we do not use && or || ? I am looking at other part of code where I used && and ||.
BTW, I am trying to apply your code here, but I am not sure I am doing it right.
Hi @JustinDoh1 ,
Try this measure for return statement:
Return
IF(OR(OR(AND(AND (min(Table1[step])= 1,NOT (min(Table1[Consent])= "Refused"), min(Table1[Consentdate])<> blank()), IFAND(AND (max(Table1[step])= 2 ,NOT (max(Table1[Consent])= "Refused"), max(Table1[Consentdate])<> blank()), AND(AND (min(Table1[step])= 1,NOT (min(Table1[Consent])= "Refused"), min(Table1[Consentdate])<> blank())), IF(AND(AND (min(Table1[step])= 1,NOT (min(Table1[Consent])= "Refused")), vimmunization < vconsent)), 0, vrefused)
I hope this helps!
Mark this as a solution if I answered your question. Kudos are always appreciated.
Thanks!
User | Count |
---|---|
51 | |
38 | |
20 | |
14 | |
13 |
User | Count |
---|---|
98 | |
71 | |
29 | |
18 | |
13 |