Forum Discussion
Anonymous
4 years agoNot applicable
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
Hi Anonymous ,
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 * -1Thanks,
Samarth
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
- Samarth_18
Community Champion
Hi Anonymous ,
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 * -1Thanks,
Samarth
- AnonymousNot applicable
Hi Samarth
Got it to work, much appreciate your help!
Thank you
I notice you are a Memorable Member, what does that mean?
- AlexisOlson
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" } )- AnonymousNot applicable
Hello Alexis
Will give it a try.
Thank you