Forum Discussion
Sum of elements
Assuming you are using this in something like a table/matrix and that this is a measure, you often have to change how this is calculated in the context of ALL. Typically do this with an IF statement and HASONEFILTER or HASONEVALUE I believe, it is a pretty common issue.
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
- dniedrauer9 years agoResolver I
the problem is hasonevalue applies to columns, not measures.
Using a column isn't realistic in this case. I'd like something that does the same thing for a measure.
- Greg_Deckler9 years agoCommunity Champion
Use HASONEFILTER.
- dniedrauer9 years agoResolver I
HASONEFILTER(switch(TRUE(),[Consumption Qty]<[Allocation -10%],[Allocation -10%]-[Consumption Qty],[Consumption Qty]>[Allocation +10%],[Allocation-Consumption]+[Allocation]*.10,0))*[Net Price])
Nope. Still asks me for a column.