Forum Discussion

dymetre973's avatar
dymetre973
Frequent Visitor
3 years ago

Need Result to Not show Zero

I am working on a dashboard project that looks at connectvity amongst domestic flights to certain international flights from the US and vice versa.

 

To start i took the arrival time of the flight or 06:45 and using a minimum connection time of 75 mins, every domestic flight departing starting from 08:00 and forward should be a viable connection.

Using a minimum connection time of 75 mins and a maximum connect time of 165 mins , im looking to write a measure that says :
If connection time is equal to or between 75 mins - 165 mins, than show  "-". If not then show minutes as a whole number.


The issue i am having is if the departure time of the domestic flight is exactly at 08:00 , making the minimum connection time of 75 mins, the result is 0, which i want it to show as "-" because it is a viable connection. 

Have tried a ton of different methods have this 0 convert to "-" but cant figure it out.

Anyone can help me with this one ?

 

 




 




 

3 Replies

  • christinepayton's avatar
    christinepayton
    Icon for Most Valuable Professional rankMost Valuable Professional

    It doesn't like your if-statement is looking at condition3 at all currently. You might consider a switch statement instead of an if-statement since you have multiple conditions going on here and add in condition3. 

     

    I would also recommend returning something that can be interpreted as a number, such as "BLANK()" instead of "-" as it's going to force the whole result to be text if any of the returns are text... you'll lose the numeric sorting/filtering. 

    • dymetre973's avatar
      dymetre973
      Frequent Visitor

      I adjusted the statement and tried SWITCH and convert to "BLANK()" instead of "-" and still getting zeros 




       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi dymetre973 ,

    Not sure. Try nesting a Round() function outside of Min(Result1, Result2) to make sure it's an integer.
    like:

    VAR MinResult = ROUND(MIN(Result1, Result2),0)

    It would be nice to have a test file without private data.
    How to provide sample data in the Power BI Forum

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum