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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PBI-Curious
Resolver I
Resolver I

Using * -1 with a Dax measure

Power BI Community Good Day!
 
The Dax below is giving me a positive value. What do I have to do to modify the Dax with * -1 to make it a negative value?
 
Net Timing = CALCULATE(SUM(metricssalescustomer[amount]),metricssalescustomer[sales_type_lvl1] = "Lost - Timing" || metricssalescustomer[sales_type_lvl1] = "Decline - Timing" || metricssalescustomer[sales_type_lvl1]= "Upsell - Timing"|| metricssalescustomer[sales_type_lvl1] = "New - Timing")
 
Much appreciate your time
 
Thank you
 
 
2 ACCEPTED SOLUTIONS
Samarth_18
Community Champion
Community Champion

Hi @PBI-Curious ,

 

You can try below code:-

Net Timing =
VAR result =
    CALCULATE (
        SUM ( metricssalescustomer[amount] ),
        metricssalescustomer[sales_type_lvl1] = "Lost - Timing"
            || metricssalescustomer[sales_type_lvl1] = "Decline - Timing"
            || metricssalescustomer[sales_type_lvl1] = "Upsell - Timing"
            || metricssalescustomer[sales_type_lvl1] = "New - Timing"
    )
RETURN
    result * -1

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

AlexisOlson
Super User
Super User

You can just stick a "-" in from of CALCULATE or SUM too but you may want to keep more visible than just a single character.

 

I'd probably do something like this:

Net Timing =
CALCULATE (
    -1 * SUM ( metricssalescustomer[amount] ),
    metricssalescustomer[sales_type_lvl1]
        IN { "Lost - Timing", "Decline - Timing", "Upsell - Timing", "New - Timing" }
)

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

You can just stick a "-" in from of CALCULATE or SUM too but you may want to keep more visible than just a single character.

 

I'd probably do something like this:

Net Timing =
CALCULATE (
    -1 * SUM ( metricssalescustomer[amount] ),
    metricssalescustomer[sales_type_lvl1]
        IN { "Lost - Timing", "Decline - Timing", "Upsell - Timing", "New - Timing" }
)

Hello Alexis

Will give it a try. 

Thank you

Samarth_18
Community Champion
Community Champion

Hi @PBI-Curious ,

 

You can try below code:-

Net Timing =
VAR result =
    CALCULATE (
        SUM ( metricssalescustomer[amount] ),
        metricssalescustomer[sales_type_lvl1] = "Lost - Timing"
            || metricssalescustomer[sales_type_lvl1] = "Decline - Timing"
            || metricssalescustomer[sales_type_lvl1] = "Upsell - Timing"
            || metricssalescustomer[sales_type_lvl1] = "New - Timing"
    )
RETURN
    result * -1

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi Samarth

Got it to work, much appreciate your help!

Thank you

PBICurious_0-1643053241368.png

I notice you are a Memorable Member, what does that mean?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors