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
Parameter define how much days i want back
- bhanu_gautam1 year agoSuper 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- Anonymous1 year agoNot applicable
Hi Adamkowalsky92 ,
I tried to reproduce your visual object, but was unsuccessful. However, I think this problem can be solved quickly. To better help you solve the problem, could you provide some example pbix? Thank you very much for your cooperation!