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(metricssale...
- 4 years ago
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
- 4 years ago
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" } )
Samarth_18
Community Champion
4 years agoHi 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 * -1
Thanks,
Samarth
Anonymous
4 years agoNot applicable
Hi Samarth
Got it to work, much appreciate your help!
Thank you
I notice you are a Memorable Member, what does that mean?