cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cma2438
Frequent Visitor

Previous Month Visual Using Week End Date

I have a report that is filtered by the Week_End_Date, one of the visuals looks at the previous month data, however, when I select the slicer to view a Week_End_Date such as 6/5/2021 (when the previous month ended in the currently selected week) the filtering won't show the new previous month until the Week_End_Date of 6/12/2021 is selected. I hope this made sense. 

While the numbers are right, I want the filters to show the real previous month in these instances. 

The Calculation i am using is show below... 

% Below 30 CALC =
CALCULATE (
values('% BELOW 30'[% Below 30]),
PREVIOUSMONTH('CALENDAR'[REPORT_DATE]))
 
What the data shows 
cma2438_0-1624480516653.png
 
What the data should show for 6/5/2021
cma2438_1-1624480553489.png

 

Calendar Table

cma2438_3-1624480724401.png

 


 



1 ACCEPTED SOLUTION
amitchandak
Super User IV
Super User IV

@cma2438 , previous month consider first date in context. Try datesmtd with endofmonth

 

% Below 30 CALC =
var _max = maxx(allselected(),'CALENDAR'[REPORT_DATE])
CALCULATE (
values('% BELOW 30'[% Below 30]),
DATESMTD(ENDOFMONTH('CALENDAR'[Date])))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
amitchandak
Super User IV
Super User IV

@cma2438 , previous month consider first date in context. Try datesmtd with endofmonth

 

% Below 30 CALC =
var _max = maxx(allselected(),'CALENDAR'[REPORT_DATE])
CALCULATE (
values('% BELOW 30'[% Below 30]),
DATESMTD(ENDOFMONTH('CALENDAR'[Date])))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

This worked! Thank you so much!

 

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors