The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
79 | |
71 | |
48 | |
41 |
User | Count |
---|---|
138 | |
108 | |
71 | |
64 | |
58 |