Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I only get results for if not HoloLens and for the other if statement where operatingSystemNew = "HoloLens" I dont get any results. How can I do this correctly so I also get the results for if operatingSystemNew = "HoloLens".
Thanks
Solved! Go to Solution.
Hi @Anonymous ,
Agree with @goncalogeraldes.
Please use SWITCH() to reduce nest IF() in your code, for example:
Windows versions =
SWITCH (
TRUE (),
[operatingSystemNEW] = "HoloLens",
IF (
AND ( [osVersion] >= "10.0.118362", [osVersion] < "10.0.18363" ),
"1903",
IF ( AND ( [osVersion] >= "10.0.18363", [osVersion] < "10.0.19042" ), "20H1" )
),
[operatingSystemNEW] <> "HoloLens",
IF (
AND ( [osVersion] >= "10.0.18362", [osVersion] < "10.0.19041" ),
"1903",
IF (
AND ( [osVersion] >= "10.0.19041.1103", [osVersion] < "10.0.19041.1128" ),
"20H1"
)
)
)
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Agree with @goncalogeraldes.
Please use SWITCH() to reduce nest IF() in your code, for example:
Windows versions =
SWITCH (
TRUE (),
[operatingSystemNEW] = "HoloLens",
IF (
AND ( [osVersion] >= "10.0.118362", [osVersion] < "10.0.18363" ),
"1903",
IF ( AND ( [osVersion] >= "10.0.18363", [osVersion] < "10.0.19042" ), "20H1" )
),
[operatingSystemNEW] <> "HoloLens",
IF (
AND ( [osVersion] >= "10.0.18362", [osVersion] < "10.0.19041" ),
"1903",
IF (
AND ( [osVersion] >= "10.0.19041.1103", [osVersion] < "10.0.19041.1128" ),
"20H1"
)
)
)
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, thank you for your solution, it will solve my problem.
But as I want to add another line I get a syntax error.
How do I add more lines?
Thank you
@Anonymous , Based on @Anonymous suggestion your additional condition goes like below:-
Windows versions =
SWITCH (
TRUE (),
[operatingSystemNEW] = "HoloLens",
IF (
AND ( [osVersion] >= "10.0.118362", [osVersion] < "10.0.18363" ),
"1903",
IF ( AND ( [osVersion] >= "10.0.18363", [osVersion] < "10.0.19042" ), "20H1" )
),
[operatingSystemNEW] <> "HoloLens",
IF (
AND ( [osVersion] >= "10.0.18362", [osVersion] < "10.0.19041" ),
"1903",
IF (
AND ( [osVersion] >= "10.0.19041.1103", [osVersion] < "10.0.19041.1128" ),
"20H1"
)
),
[condition3] = "condition3", IF ( a = a, TRUE (), FALSE () )
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hello there @Anonymous ! Have you tried using a SWITCH() in this case? It can heavily reduce and simplify your code 🙂 Try something in the lines of:
Windows Versions =
SWITCH(
TRUE () ,
condition1, result1,
condition2, result2,
...,
else
)
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.