Forum Discussion
LeszekGL
1 year agoNew Member
Problem with Total sales calculation - please help
Hello everyone I am having a problem getting the correct sales total. In the example below, I am calculating the sales total from the beginning of each month to the 10th of the month....
- Anonymous1 year ago
Hi LeszekGL ,
Based on your description, I created these data.
Create MEASURE.MEASURE = VAR _mindate = EOMONTH ( MIN ( 'Table'[Date] ), -1 ) + 1 VAR _maxdate = EOMONTH ( MAX ( 'Table'[Date] ), -1 ) + 10 VAR _sum1 = CALCULATE ( SUM ( 'Table'[Amount] ), 'Table'[Date] >= _mindate && 'Table'[Date] <= _maxdate ) RETURN _sum1Measure 2 = SUMX('Table',[MEASURE])Measure 3 = IF(HASONEVALUE('Table'[Date].[Month]),[MEASURE],[Measure 2])If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
1 year agoNot applicable
Hi LeszekGL ,
Based on your description, I created these data.
Create MEASURE.
MEASURE =
VAR _mindate =
EOMONTH ( MIN ( 'Table'[Date] ), -1 ) + 1
VAR _maxdate =
EOMONTH ( MAX ( 'Table'[Date] ), -1 ) + 10
VAR _sum1 =
CALCULATE (
SUM ( 'Table'[Amount] ),
'Table'[Date] >= _mindate
&& 'Table'[Date] <= _maxdate
)
RETURN
_sum1
Measure 2 =
SUMX('Table',[MEASURE])
Measure 3 =
IF(HASONEVALUE('Table'[Date].[Month]),[MEASURE],[Measure 2])
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- LeszekGL1 year agoNew Member
Hello Clara
Works fine - thanks a lot !!!
Leszek