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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
bilingual
Helper V
Helper V

Previous Month as filter not as running value

Hi, i have made the formula 

Last Month = CALCULATE(SUM(Data_akk[Antal rejser]);PREVIOUSMONTH(Kalender[Dato]))
It works fine as a variable, but what i need is PREVIOUSMONTH as a filter, so my graph every month only shows the values of last month, can anybody help? 🙂
 
i have made Calender table in M , should i add there?
 
Kindr regards Daniel
 

 

1 ACCEPTED SOLUTION
inna_sysco
Helper II
Helper II

Hi @bilingual !

I am assuming that you can create a calculated column in your Calendar table and determine the "previous month" with a similar formula:

Prev_month = IF (
AND (
'Calendar'[Date]
>= DATE ( YEAR ( NOW () ), MONTH ( NOW () ) - 1, 1 ),
'Calendar'[Date]
<= DATE ( YEAR ( NOW () ), MONTH ( NOW () ), 1 ) - 1
),
"*Previous month",
'Calendar'[MonthName]&" "&'Calendar'[Year]
)


Then it will not be a problem to use this column as a visual and page-level filter. 

Best wishes, Inna

View solution in original post

5 REPLIES 5
inna_sysco
Helper II
Helper II

Hi @bilingual !

I am assuming that you can create a calculated column in your Calendar table and determine the "previous month" with a similar formula:

Prev_month = IF (
AND (
'Calendar'[Date]
>= DATE ( YEAR ( NOW () ), MONTH ( NOW () ) - 1, 1 ),
'Calendar'[Date]
<= DATE ( YEAR ( NOW () ), MONTH ( NOW () ), 1 ) - 1
),
"*Previous month",
'Calendar'[MonthName]&" "&'Calendar'[Year]
)


Then it will not be a problem to use this column as a visual and page-level filter. 

Best wishes, Inna

Hi Inna, it works almost, however, it only adds last month for the first date of the month, example 1 of february

@bilingual , hmm, it's a bit strange...
I use the same formula and result on the screenshot below:

inna_sysco_0-1615287673086.png
Could you, please, share some screenshots from your report?

 

Thanks a lot Inna, it was my mistake in the formula !

@bilingual , you're welcome!😉

Inna

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors