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
Syndicate_Admin
Administrator
Administrator

DATEADD from another measure

Hello!

I need to generate a formula that brings me the minimum date of a column, minus 3 months.

Generate a calculated measure to bring back the oldest date (MIN). That's what I wanted to apply a Dateadd to, but since it's not a date table, it doesn't allow me to generate the formula.

Thank you very much from now, I hope you have understood what I am looking for.

Best regards.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Verosb ,

You can create a measure as below to get it, please find the details in the attachment.

3 months before Mindate = 
VAR _mindate =
    CALCULATE ( MIN ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
VAR _premonth =
    EOMONTH ( _mindate, -3 )
VAR _minday =
    DAY ( _mindate )
VAR _preday =
    DAY ( _premonth )
RETURN
    IF (
        _minday > _preday,
        _premonth,
        DATE ( YEAR ( _premonth ), MONTH ( _premonth ), DAY ( _mindate ) )
    )

yingyinr_1-1669615069230.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Verosb ,

You can create a measure as below to get it, please find the details in the attachment.

3 months before Mindate = 
VAR _mindate =
    CALCULATE ( MIN ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
VAR _premonth =
    EOMONTH ( _mindate, -3 )
VAR _minday =
    DAY ( _mindate )
VAR _preday =
    DAY ( _premonth )
RETURN
    IF (
        _minday > _preday,
        _premonth,
        DATE ( YEAR ( _premonth ), MONTH ( _premonth ), DAY ( _mindate ) )
    )

yingyinr_1-1669615069230.png

Best Regards

Shaurya
Memorable Member
Memorable Member

Hi @Syndicate_Admin,

 

You can use:

 

Min Date Minus 3 Months = DATE(YEAR(MIN('Table'[Date])),MONTH(MIN('Table'[Date]))-3,DAY(MIN('Table'[Date])))

 

Works for you? Mark this post as a solution if it does!
Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.