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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
admin11
Memorable Member
Memorable Member

How to modify my expression , so that -ve value will not be display

Hi All

 
i have AR Table working fine , except it display +ve and -ve value.
 
I have below expression working fine :-
AR_AMT_NEW = if(ROUND(sum(AR[A/R amount include GST in LC]),0)=0, blank(),sum(AR[A/R amount include GST in LC]))
 
I want to filter off those -ve value , as -ve value refer to customer paid us extra. 
 
Can some one share with me where to put the *-1 , so that it onlt display +ve vaue.
 

admin11_0-1618234806733.png

 

Paul

1 ACCEPTED SOLUTION

Hi @admin11 ,

If you want to display negative numbers as positive numbers, for example, -5778.00 is displayed as 5778.00, then try the following formula.

AR_AMT_NEW = 
var _sum = sum(AR[A/R amount include GST in LC])
return 
    SWITCH(
        TRUE(),
        ROUND(_sum,0)=0, blank(),
        _sum<0, _sum*-1,
        _sum
    )


If you want to display negative numbers as empty values, then try the following formula.

Measure = 
var _sum = sum(AR[A/R amount include GST in LC])
return 
    IF(
        ROUND(_sum,0) = 0 || _sum < 0, 
        blank(),
        _sum
    )

image.png

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

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

4 REPLIES 4
aj1973
Community Champion
Community Champion

@admin11 

Add -1 before IF 

AR_AMT_NEW = -( if(ROUND(sum(AR[A/R amount include GST in LC]),0)=0, blank(),sum(AR[A/R amount include GST in LC])) )

 

You can also use ABS function

AR_AMT_NEW = ABS(if(ROUND(sum(AR[A/R amount include GST in LC]),0)=0, blank(),sum(AR[A/R amount include GST in LC])))

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

amitchandak
Super User
Super User

@admin11 , Try a measure like

AR_AMT_NEW =
var _1 = sum(AR[A/R amount include GST in LC])
return
Switch( Round(_1,0)=0, blank()
_1 <0 , _1*1 ,
_1)

@amitchandak Thank you for sharing.

I Get error msg.

admin11_0-1618266280638.png

 

Hi @admin11 ,

If you want to display negative numbers as positive numbers, for example, -5778.00 is displayed as 5778.00, then try the following formula.

AR_AMT_NEW = 
var _sum = sum(AR[A/R amount include GST in LC])
return 
    SWITCH(
        TRUE(),
        ROUND(_sum,0)=0, blank(),
        _sum<0, _sum*-1,
        _sum
    )


If you want to display negative numbers as empty values, then try the following formula.

Measure = 
var _sum = sum(AR[A/R amount include GST in LC])
return 
    IF(
        ROUND(_sum,0) = 0 || _sum < 0, 
        blank(),
        _sum
    )

image.png

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

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.