Forum Discussion
MagikJukas
Resolver III
3 years agosum values's measure below zero
Hello, I created this formula, I first calculate the cummulated value by date, and then I want to extract the values that are below zero. Measure = VAR proj=CALCULATE(SUM(Data[Qty]),FILTER...
- 3 years ago
Solution can de found here:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Summarize-table-missing-data/m-p/3034695#M103855
FreemanZ
Super User
3 years agohi MagikJukas
try like:
Measure =
VAR proj=
CALCULATE(SUM(Data[Qty]),FILTER(ALLSELECTED('Date list'[Date]),'Date list'[Date]<=MAX('Date list'[Date])))+0
VAR tab=
SUMMARIZE(Data,Data[Material],"tot",proj)
VAR _value =
CALCULATE(SUMX(FILTER((tab),[tot<0),proj))
VAR _value2=SUM(Data[Qty])
RETURN
IF(_value = BLANK(), _value2, _value)
MagikJukas
Resolver III
3 years agothank you, but it does not change much.
the problem is how the "proj" function is consolidated. Data[Qty] have both positive and negative values.
It seems that with SUMX it considers all the [Qty] that are negative. Instead, I am looking for the "proj" which is the sum of the [Qty].