Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi guys!
I need to compare the evolution of sales (cummulativeday by day) vs the previous month day by day.
Using previousmonth what I get is the total of the previous month.
for example:
Is there a way to do so?
Solved! Go to Solution.
Hi, please try with this little change:
Sales Currenth Month =
VAR SelectedDay =
SELECTEDVALUE ( Table1[Day of Month] )
RETURN
CALCULATE (
SUM ( Table1[Sales] );
FILTER (
ALL ( Table1 );
MONTH ( Table1[Date] ) = MONTH ( TODAY () )
&& Table1[Day of Month] <= SelectedDay
)
)Sales Previous Month =
VAR SelectedDay =
SELECTEDVALUE ( Table1[Day of Month] )
RETURN
CALCULATE (
SUM ( Table1[Sales] );
FILTER (
ALL ( Table1 );
MONTH ( Table1[Date] )
= MONTH ( TODAY () ) - 1
&& Table1[Day of Month] <= SelectedDay
)
)Regards
Victor
Lima - Peru
Hi,
Try this measure
=CALCULATE([Sales],DATESBETWEEN('Calendar'[Date],EDATE(MIN('Calendar'[Date]),-1),EDATE(MIN('Calendar'[Date]),-1)))
There is a relatiosnhip from the Date column of the Data Table to the Date column of the Calendar Table. In the Pivot/visual, drag the date from the calendar table.
Hope this helps.
Hi, please try with this little change:
Sales Currenth Month =
VAR SelectedDay =
SELECTEDVALUE ( Table1[Day of Month] )
RETURN
CALCULATE (
SUM ( Table1[Sales] );
FILTER (
ALL ( Table1 );
MONTH ( Table1[Date] ) = MONTH ( TODAY () )
&& Table1[Day of Month] <= SelectedDay
)
)Sales Previous Month =
VAR SelectedDay =
SELECTEDVALUE ( Table1[Day of Month] )
RETURN
CALCULATE (
SUM ( Table1[Sales] );
FILTER (
ALL ( Table1 );
MONTH ( Table1[Date] )
= MONTH ( TODAY () ) - 1
&& Table1[Day of Month] <= SelectedDay
)
)Regards
Victor
Lima - Peru
Hi @Giskard,
Please try measures:
current month sales =
CALCULATE (
SUM ( 'Table 2'[Cummulative Sales] ),
FILTER ( 'Table 2', 'Table 2'[Date].[MonthNo] = MONTH ( TODAY () ) )
)
previous month sales =
CALCULATE (
SUM ( 'Table 2'[Cummulative Sales] ),
FILTER ( 'Table 2', 'Table 2'[Date].[MonthNo] = MONTH ( TODAY () ) - 1 )
)
Best regards,
Yuliana Gu
Thanks a lot Yuliana!
Unfortunataly is not working.
Im getting the values daily but is not summing them.
Also I believe the TODAY part is the one causing I cant change the filter to other month.
What I have is a main fact and a date dimension.
I tried this measure:
AcumuladoCET = CALCULATE(SUM(DetalleCanal[CET]),filter(DimDate,DimDate[MonthofYear]=MONTH(today())))
I think thats what you did. What Im doing wrong?
Thanks once again!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.