Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi
I am trying to write some DAX to add 5 different measures together. However, I only want to add the measures, where their result is positive i.e. >0. Below are the 5 measures:
Solved! Go to Solution.
The most basic way would be to create variables, where there value is defined by an if statement and return the sum.
Measure =
var _m1 = if([Advocate Partner Count Change] > 0, [Advocate Partner Count Change], 0)
var _m2 = if([Engaged Count Change] > 0, [Engaged Count Change], 0)
var _m3 = if([Interested Count Change] > 0, [Interested Count Change], 0)
var _m4 = if([Neutral Count Change] > 0, [Neutral Count Change], 0)
var _m5 = if([No / Blank Count Change]>0, [No / Blank Count Change], 0)
return _m1+_m2+_m3+_m4+_m5
The most basic way would be to create variables, where there value is defined by an if statement and return the sum.
Measure =
var _m1 = if([Advocate Partner Count Change] > 0, [Advocate Partner Count Change], 0)
var _m2 = if([Engaged Count Change] > 0, [Engaged Count Change], 0)
var _m3 = if([Interested Count Change] > 0, [Interested Count Change], 0)
var _m4 = if([Neutral Count Change] > 0, [Neutral Count Change], 0)
var _m5 = if([No / Blank Count Change]>0, [No / Blank Count Change], 0)
return _m1+_m2+_m3+_m4+_m5
That's amazing thank you! I was trying to use VAR, as I had a feeling that was the route I needed, but I'm not familiar enough with the syntax yet. I'm making the jump from having marginally above average Excel skills, to Power BI and it seems to me to be where Excel meets simple programming language. Really appreciate you taking the time to answer. thank you.
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
14 | |
10 | |
7 |