Forum Discussion
Dynamic Previous and Current Total Sales Calculation
- 4 years ago
Hi Anonymous ,
Without any data is difficult to give you the correct answer however believe that your measures are lacking the context especially the last one try the following:
YTD Sales till last month = CALCULATE ( SUM ( Sales[Sales Amount] ), DATESYTD ( 'Date'[Date], "06/30" ), FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= EOMONTH ( MAX ( 'Date'[Date] ), -1 ) ) ) - Anonymous4 years ago
Hi Anonymous ,
Please update the formula of measure [YTD Sales till last month] as below:
YTD Sales till last month = CALCULATE ( [YTD Sales], PREVIOUSMONTH ( 'Date'[Date] ) )Alternatively, since we don't know which fields you have applied as slicer options, we can't give you the appropriate measure. You can refer to the following blog to determine if the slicer has any options selected and change your measure based on your scenario.
No slicer selected — No chart in Power BI
If the above ones can't help you find the solution, please provide more details(sample data, slicer setting or your sample pbix file etc.) for your requirement. Thank you.
Best Regards
Hi Anonymous ,
Without any data is difficult to give you the correct answer however believe that your measures are lacking the context especially the last one try the following:
YTD Sales till last month =
CALCULATE (
SUM ( Sales[Sales Amount] ),
DATESYTD ( 'Date'[Date], "06/30" ),
FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= EOMONTH ( MAX ( 'Date'[Date] ), -1 ) )
)