Forum Discussion

Rabi's avatar
Rabi
Resolver I
2 years ago
Solved

Converting Calculated column into Measure or IF statement return Alternative

Hi Everyone, 

 

How can I convert this Dax to measure,

CARER EXCESS = if([Additional hrs to meet target care min] <0,[Additiona hrs to meet target care min],0)*-1
 
Or Alternatively How can i return "-" instead of 0 in the same dad.
 
Regards,
Rabi
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Rabi ,

     

    Based on your description, I'm wondering that you want to change a negative number in a column of data to a positive number and replace the positive number with a "-"

     

    I did a simple test and the result is as follows:

    CARER EXCESS = 
    VAR _1= 
    if(MIN('Table'[Number]) <0,MIN('Table'[Number]),0)*-1
    VAR _2 = IF(_1 = 0,"-",_1)
    RETURN
    _2

     

    Please feel free to correct me and provide more information if I have misunderstood you!

    An attachment for your reference. Hope it helps!

    Best regards,
    Community Support Team_ Scott Chang

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Rabi ,

     

    Based on your description, I'm wondering that you want to change a negative number in a column of data to a positive number and replace the positive number with a "-"

     

    I did a simple test and the result is as follows:

    CARER EXCESS = 
    VAR _1= 
    if(MIN('Table'[Number]) <0,MIN('Table'[Number]),0)*-1
    VAR _2 = IF(_1 = 0,"-",_1)
    RETURN
    _2

     

    Please feel free to correct me and provide more information if I have misunderstood you!

    An attachment for your reference. Hope it helps!

    Best regards,
    Community Support Team_ Scott Chang

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.