Forum Discussion
Incorrect SUM
- 1 year ago
I resolves problem myself ny using
SUMX(
SUMMERIZE(
Sales,Sales[Client],"Sum",CALCULATE(SUM(Sales[Value]),Sales[Date]=MAX(Sales[Date]))),Sum)
_
SUMX(
SUMMERIZE(
Sales,Sales[Client],"Sum",CALCULATE(SUM(Sales[Value]),Sales[Date]=MAX(Sales[Date])-1)),Sum)
Adamkowalsky92 , Can you share formula which you have used
- Adamkowalsky921 year agoFrequent Visitor
Parameter define how much days i want back- bhanu_gautam1 year ago
Super User
Adamkowalsky92 Try using
dax
VAR maxday = MAX(Sales[Day])
VAR beforeday = CALCULATE(MAX(Sales[Day]), Sales[Day] < maxday)
VAR sales = CALCULATE(SUM(Sales[Value]), Calendar[Date] = maxday)
VAR salesbefore = CALCULATE(SUM(Sales[Value]), Calendar[Date] = beforeday)
RETURN
SUMX(
VALUES(Sales[Day]),
sales - salesbefore
)- Adamkowalsky921 year agoFrequent Visitor
Unfortunately, this is not a suitable solution:
1. you have not added a parameter option that defines the value by a certain number of days
2. I want the sum of only one day, not all earlier than max date