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
CG12
Frequent Visitor

Filter by Current Month and Last Month using Calculated Column

Hi Folks,

 

This has been a headscratacher for me. Basically I am trying to get a frequency count of a particular column from another table but only from within a particular month (kind of dynamic) - Current Month, Last Month, Month previous to that. 

 

Based on research I tried to do the following 
https://community.powerbi.com/t5/Desktop/Current-Month-Previous-Month-and-Before-Previous-Month/td-p...
To give me the following -

FrequencyCurrentMonth = CALCULATE(COUNT('Table1'[Prospect]),RELATEDTABLE('Table1'),FILTER(ALL('Table1'),MONTH('Table1'[DateTime])=MONTH(TODAY())))

 

This gave me a blank values with no return. 

 

Was wondering if you can advice or is there something I can use?

 

Thanks 

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @CG12 

Your best bet in the time intelligent function DATESINPERIOD.  You will need a date table but then your calculation is just something like:

3 MO Prospect = 
VAR EndingDate = MAX ( Dates[Date] )
RETURN 
CALCULATE(
    [Prospect],
    DATESINPERIOD(Dates[Date],EndingDate,-3,MONTH)
)

3MoProspect.jpg
Could you maybe share a sample of your data model if the above doesn't work for you?

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

Hello @CG12 

Your best bet in the time intelligent function DATESINPERIOD.  You will need a date table but then your calculation is just something like:

3 MO Prospect = 
VAR EndingDate = MAX ( Dates[Date] )
RETURN 
CALCULATE(
    [Prospect],
    DATESINPERIOD(Dates[Date],EndingDate,-3,MONTH)
)

3MoProspect.jpg
Could you maybe share a sample of your data model if the above doesn't work for you?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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