Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
Super User

@Anonymous , 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])))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , 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])))

Anonymous
Not applicable

This worked! Thank you so much!

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.