Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Rabi
Resolver I
Resolver I

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
1 ACCEPTED SOLUTION
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:

vtianyichmsft_0-1697449264246.png

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.

View solution in original post

2 REPLIES 2
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:

vtianyichmsft_0-1697449264246.png

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.

vicky_
Super User
Super User

You can probably do so using the Dynamic Formatting Strings if you have a more recent version of powerbi: https://www.sqlbi.com/articles/introducing-dynamic-format-strings-for-dax-measures/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.