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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Combine Slicer (Date from...until...) and function 'prevoiusmonth'

Hi folks,

 

i have a question about slicers and the function „previousmonth“. I calculated flexitime (starts in 2003 until today). I use a date slicer, which shows date from (2003-01-01) until date (2019-11-15). I would like to see flexitime at the same date just the previous month (2019-10-15).

I tried this measure:

 

Flexitime last Month = CALCULATE([Flexitime];PREVIOUSMONTH(Kalender[Datum])

 

Unfortunately I get a empty column.

 

Does anybody can help me?

 

Thanks for your help

freiburgc

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for your answer @RobbeVL!

 

I found an answer:

 

Flextime last month =CALCULATE([flextime];DATEADD(Calendar[Date];-1;MONTH))

View solution in original post

2 REPLIES 2
RobbeVL
Impactful Individual
Impactful Individual

Hi,

When you use PREVIOUSMONTH, it actually returns the value of the complete previous month.

The function Previousmonth on a day level does not exist. This is because the different of numbers of days per month differs. 

 

What is your expected output wheb you want last month of 30/03/2019

 

Also I dont know what your data is about, but comparing the monthnumbers is usually not very insightfull. 

Try having a look at weeknumbers ? 

 

Although it is not impossible to create what you requested.

 

Have a look here:


https://community.powerbi.com/t5/Desktop/PREVIOUSMONTH/td-p/13307

Anonymous
Not applicable

Thanks for your answer @RobbeVL!

 

I found an answer:

 

Flextime last month =CALCULATE([flextime];DATEADD(Calendar[Date];-1;MONTH))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.