Forum Discussion

Hadill's avatar
Hadill
Helper I
4 years ago
Solved

How to write conditioned DAX

Hi there,   I am trying to type a DAX formula that satisfies the following condition:   if the 'sales'[sales-number] contains Number, then print 'Sold Out' and if it is empty, then print 'Ready ...
  • ValtteriN's avatar
    4 years ago

    Hi,


    Like Amit said you can use PQ or if you want a dax solution:

    You can achieve this by either checking for blank

    IF(SELECTEDVALUE('ALL'[Value])=BLANK(),"Ready for Sale","Sold Out")


    Or checking for number: 

    IFERROR(
    IF(
    ISNUMBER(VALUE(max('ALL'[Value]))),"Sold Out"),"Ready for Sale")


    Example:

     


     



    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/