Forum Discussion
Equivalent to Set Analysis
- 10 years ago
From your description, I think what you need is the CALCULATE function. For a description of CALCULATE, see http://www.powerpivotpro.com/2014/03/becoming-one-with-calculate/ and https://msdn.microsoft.com/en-us/library/ee634825.aspx. Your formula would look something like:
NameofMeasure = CALCULATE(SUM([Value]),[Condition]=1) / SUM([Value])
The equivalent in DAX for the formula you present is something along the lines of:
MyMeasure = SUM([Value])/CALCULATE(SUM([Value]),ALL(Table))
I'm doing that from memory so there may be a syntax error or two but basically you put this measure in a table with the column where you have the conditions and the measure will be automagically filtered to that row except for the denominator, which has the ALL clause so it will include everthing in "Table".
Can't really help more without sample data, relationships, etc.
If you really want to make it only applicable to "1", then you would do this:
MyMeasure = CALCULATE(SUM([Value]),[Condition] = "1")/CALCULATE(SUM([Value]),ALL(Table))
But I think a measure as described above would ultimately be the better route.