Forum Discussion
Combining 2 different if statements in one
Mmoizk,
I would create a calculated column using DateDiff; this will produce a new column with a value as the number of days from today that TargetStartDate. Alternatly you can use this in-line which may be optimal depending on your data.
Using the new column it would look something like this example (replacing the Fund Balance with your new Date Diff field or keeping it inline)
Fund Size:=SWITCH(TRUE(),
AND([Fund Balance]>=0, [Fund Balance]<=10000), “Up to $10,000”,
AND([Fund Balance]>=10001, [Fund Balance]<=50000), “$10,001 to 50,000”,
AND([Fund Balance]>=50001, [Fund Balance]<=100000), “$50,001 to 100,000”,
AND([Fund Balance]>=100001, [Fund Balance]<=500000), “$100,001 to 500,000”,
AND([Fund Balance]>=1500001, [Fund Balance]<=1000000), “$500,001 to 1,000,000”,
“greater than $1,000,000”
)
Hope this helps!
Teal Canady
Credit to the Power Pivot Pro Site for the example above
http://www.powerpivotpro.com/2012/06/dax-making-the-case-for-switch/
Thanks Teal , datediff isn't working for future dates
- TealCanady10 years ago
Advocate II
Can you show me your exact formula? DateDiff should be agnostic of future dates. =DateDiff(GetDate(),[EndDate],Day) should work; if you can send me the error / formula that would be great.
Teal