Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi everyone,
Can you help to debug this formula please ?
IF(AND(Tableau_owssvr_1[Project complexity]="simple";Tableau_owssvr_1[Adressed request time]<5);"on-time";IF(AND(Tableau_owssvr_1[Project complexity]="simple";Tableau_owssvr_1[Adressed request time]>5);"delay";IF(AND(Tableau_owssvr_1[Project complexity]="medium";Tableau_owssvr_1[Adressed request time]<10);"on-time";IF(AND(Tableau_owssvr_1[Project complexity]="medium";Tableau_owssvr_1[Adressed request time]>10));"delay";IF(AND(Tableau_owssvr_1[Project complexity]="complex";Tableau_owssvr_1[Adressed request time]<15);"on-time";IF(AND(Tableau_owssvr_1[Project complexity]="complex";Tableau_owssvr_1[Adressed request time]>15);"delay";)))))
Thanks a lot,
Benjamin
Solved! Go to Solution.
Hi @benjaminlvdr,
As @parry2k said this is not the best way to have your question answer however I believe I have found your error check the bold part below, you have 2 brackets in the middle of your formula closing it earlier than you need.
IF(AND(Tableau_owssvr_1[Project complexity]="simple";Tableau_owssvr_1[Adressed request time]<5);"on-time";IF(AND(Tableau_owssvr_1[Project complexity]="simple";Tableau_owssvr_1[Adressed request time]>5);"delay";IF(AND(Tableau_owssvr_1[Project complexity]="medium";Tableau_owssvr_1[Adressed request time]<10);"on-time";
IF(AND(Tableau_owssvr_1[Project complexity]="medium";Tableau_owssvr_1[Adressed request time]>10)) <- this bracket is to much
;"delay";IF(AND(Tableau_owssvr_1[Project complexity]="complex";Tableau_owssvr_1[Adressed request time]<15);"on-time";IF(AND(Tableau_owssvr_1[Project complexity]="complex";Tableau_owssvr_1[Adressed request time]>15);"delay"Smiley Wink))))
On best practices your formula should be written like this:
Formula = IF ( AND ( Tableau_owssvr_1[Project complexity] = "simple"; Tableau_owssvr_1[Adressed request time] < 5 ); "on-time"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "simple"; Tableau_owssvr_1[Adressed request time] > 5 ); "delay"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "medium"; Tableau_owssvr_1[Adressed request time] < 10 ); "on-time"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "medium"; Tableau_owssvr_1[Adressed request time] > 10 ); "delay"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "complex"; Tableau_owssvr_1[Adressed request time] < 15 ); "on-time"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "complex"; Tableau_owssvr_1[Adressed request time] > 15 ); "delay"; "" ) ) ) ) ) )
don't know what the smiley face in the end represent I placed a "".
But to improve overall legebility and performance you should redo your measure to this:
ttt = SWITCH ( TRUE (); Tableau_owssvr_1[Project complexity] = "simple" && Tableau_owssvr_1[Adressed request time] < 5; "on-time"; Tableau_owssvr_1[Project complexity] = "simple" && Tableau_owssvr_1[Adressed request time] > 5; "delay"; Tableau_owssvr_1[Project complexity] = "medium" && Tableau_owssvr_1[Adressed request time] < 10; "on-time"; Tableau_owssvr_1[Project complexity] = "medium" && Tableau_owssvr_1[Adressed request time] > 10; "delay"; Tableau_owssvr_1[Project complexity] = "complex" && Tableau_owssvr_1[Adressed request time] < 15; "on-time"; Tableau_owssvr_1[Project complexity] = "complex" && Tableau_owssvr_1[Adressed request time] > 15; "delay"; "" )
As you can see it's much shorte and easier to read, again the "" on the end should be replace by what you have on your smiley face.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @benjaminlvdr,
Agree with MFelix.
Have you solved your problem?
If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
In addition, you could use this dax format tool to check if your dax formulas have syntax error.
If you still need help, please feel free to ask.
Best Regards,
Cherry
Hi @benjaminlvdr,
As @parry2k said this is not the best way to have your question answer however I believe I have found your error check the bold part below, you have 2 brackets in the middle of your formula closing it earlier than you need.
IF(AND(Tableau_owssvr_1[Project complexity]="simple";Tableau_owssvr_1[Adressed request time]<5);"on-time";IF(AND(Tableau_owssvr_1[Project complexity]="simple";Tableau_owssvr_1[Adressed request time]>5);"delay";IF(AND(Tableau_owssvr_1[Project complexity]="medium";Tableau_owssvr_1[Adressed request time]<10);"on-time";
IF(AND(Tableau_owssvr_1[Project complexity]="medium";Tableau_owssvr_1[Adressed request time]>10)) <- this bracket is to much
;"delay";IF(AND(Tableau_owssvr_1[Project complexity]="complex";Tableau_owssvr_1[Adressed request time]<15);"on-time";IF(AND(Tableau_owssvr_1[Project complexity]="complex";Tableau_owssvr_1[Adressed request time]>15);"delay"Smiley Wink))))
On best practices your formula should be written like this:
Formula = IF ( AND ( Tableau_owssvr_1[Project complexity] = "simple"; Tableau_owssvr_1[Adressed request time] < 5 ); "on-time"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "simple"; Tableau_owssvr_1[Adressed request time] > 5 ); "delay"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "medium"; Tableau_owssvr_1[Adressed request time] < 10 ); "on-time"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "medium"; Tableau_owssvr_1[Adressed request time] > 10 ); "delay"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "complex"; Tableau_owssvr_1[Adressed request time] < 15 ); "on-time"; IF ( AND ( Tableau_owssvr_1[Project complexity] = "complex"; Tableau_owssvr_1[Adressed request time] > 15 ); "delay"; "" ) ) ) ) ) )
don't know what the smiley face in the end represent I placed a "".
But to improve overall legebility and performance you should redo your measure to this:
ttt = SWITCH ( TRUE (); Tableau_owssvr_1[Project complexity] = "simple" && Tableau_owssvr_1[Adressed request time] < 5; "on-time"; Tableau_owssvr_1[Project complexity] = "simple" && Tableau_owssvr_1[Adressed request time] > 5; "delay"; Tableau_owssvr_1[Project complexity] = "medium" && Tableau_owssvr_1[Adressed request time] < 10; "on-time"; Tableau_owssvr_1[Project complexity] = "medium" && Tableau_owssvr_1[Adressed request time] > 10; "delay"; Tableau_owssvr_1[Project complexity] = "complex" && Tableau_owssvr_1[Adressed request time] < 15; "on-time"; Tableau_owssvr_1[Project complexity] = "complex" && Tableau_owssvr_1[Adressed request time] > 15; "delay"; "" )
As you can see it's much shorte and easier to read, again the "" on the end should be replace by what you have on your smiley face.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@benjaminlvdr what is the issue?
Please use this link to a pors on how to get your question answered quickly.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
121 | |
76 | |
63 | |
51 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |