cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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")

Thank you

2 ACCEPTED SOLUTIONS
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.

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" }
)``````
4 REPLIES 4
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" }
)``````
Resolver I

Hello Alexis

Will give it a try.

Thank you

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.

Resolver I

Hi Samarth

Got it to work, much appreciate your help!

Thank you

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

Announcements

#### 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.

#### Power BI Monthly Update - June 2024

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

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors