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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
luistiscornia
Regular Visitor

undefined

Hello! I am new to PowerBi. I need help to know which formula to occupy so that the difference between 2 variable numbers of a calculation is always shown in positive value. Since if I use "calculate" in the case that the second value is greater than the first, obviously it returns a negative number as a result. How can I make the result that I always subtract in second place from the number with the lowest value and show me the name of who that difference corresponds to. I clarify that the calculation will always be performed only between two values. Thanks! 2021-06-22 17_35_56-DATOSPBAGIT.png

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @luistiscornia ,

 

you can use the ABS function to get the absolute number (the positive number) of a value.

So if it's 715 it will return 715 and if it's -715 it will return 715.

 

You can use that with your CALCULATE function:

MyMeasure = ABS( CALCULATE( ... ) )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @luistiscornia ,

 

Does your problem have been solved? If it is solved, please mark a reply which is helpful to you.

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

 

Best Regards,
Winniz

selimovd
Super User
Super User

Hey @luistiscornia ,

 

you can use the ABS function to get the absolute number (the positive number) of a value.

So if it's 715 it will return 715 and if it's -715 it will return 715.

 

You can use that with your CALCULATE function:

MyMeasure = ABS( CALCULATE( ... ) )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Another option is to simply format the measure to not show the negative sign by changing the custom format to show positive and negative values the same.

 

AlexisOlson_0-1624397898443.png

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors
Top Kudoed Authors