Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello community,
I am struggling closing an IF statement, it's almost done but there is something else I need to do.
Basically when the if statement is calculated, I just want to in casa the result is -1, to give me a 0, else give me the result of the IF statement.
I tried to do a nested IF statement: IF( IF ( ...normal statement) = -1, 0 ) but it's not working. Doesn't give me back the results of the inside IF statement when it's not -1.
Any thoughts???
I have attached a screenshot of the IF statement and the result.
Thank you so much,
Manu
Solved! Go to Solution.
Hi @ManuApo
Calculate the value first then check if it equals -1 and return the appropriate value
Use this code - note that I haven't typed out the entire CALCULATE. Please supply code as text raher than an image so it doesn't have to be retyped.
First answer by UW Timeline =
VAR Res = CALCULATE( SUM('Calendar'[Workday]), .......
RETURN
IF (Res = -1, 0, Res)
Regards
Phil
Proud to be a Super User!
Hi @ManuApo
Calculate the value first then check if it equals -1 and return the appropriate value
Use this code - note that I haven't typed out the entire CALCULATE. Please supply code as text raher than an image so it doesn't have to be retyped.
First answer by UW Timeline =
VAR Res = CALCULATE( SUM('Calendar'[Workday]), .......
RETURN
IF (Res = -1, 0, Res)
Regards
Phil
Proud to be a Super User!
Thank you so much @PhilipTreacy !!
I dont know how I couldn't think about that one!
Thanks again 🙂
Manu.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
56 | |
38 | |
34 |
User | Count |
---|---|
99 | |
56 | |
51 | |
44 | |
40 |