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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

I want to display the count of customers created in the last three months.

Date of creation column is there to do the calculation.

Please help me to do the same using Date Between, Date Add functions.

Please

 

Used the following formula, Insteasd of 90 days, I want to add month number

New Customer in Last 3 Months New =
CALCULATE( DISTINCTCOUNT(Sales[CustomerCode]),
DATESBETWEEN('Sales'[DateofOrder],
TODAY()-90,
TODAY()
))
3 REPLIES 3
Anonymous
Not applicable

Time-intelligence functions DO NOT WORK on date columns in tables that are not proper Date tables.

Please learn a bit about these functions and how to correctly handle time in PBI models (date/time dimensions).

Best
Darek
Anonymous
Not applicable

Already created calendar table manually. And defined relationship between calendar date column and customer creation date column. So it will work right?
Anonymous
Not applicable

Instead of writing

 

New Customer in Last 3 Months New =
CALCULATE( DISTINCTCOUNT(Sales[CustomerCode]),
    DATESBETWEEN('Sales'[DateofOrder],
    TODAY()-90,
    TODAY()
    )
)

you should use the Date table

New Customer in Last 3 Months New =
var __today = TODAY()
var __90DaysBackFromToday = TODAY() - 90 + 1 -- yes, you have to add 1
var output =
CALCULATE (
    DISTINCTCOUNT( Sales[CustomerCode] ),
    DATESBETWEEN (
        'Dates'[Date],
        __90DaysBackFromToday,
        __today
    )
)

Best

Darek

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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