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

Dax future time period

Working with time periods, I have what I want for the past, but how can I add in future? Looking for Next 90 days, etc
Current dax

 
Time Periods =
var _today =
    MAX ( 'Date Refresh'[Date])
var _thisyear =
    YEAR ( _today )
var _thismonth =
    MONTH ( _today )
var _thisday =
    DAY ( _today )
return
    SELECTCOLUMNS(
        UNION(
            //Yesterday
            ADDCOLUMNS(
                GENERATE(
                    SELECTCOLUMNS( {"Yesterday"}, "Period", [Value] ),
                    GENERATESERIES(DATE(_thisyear, _thismonth, _thisday -1), _today -1)
                ),
                "Axis Date", [Value]
            ),
            //Last30Days
            ADDCOLUMNS(
                GENERATE(
                    SELECTCOLUMNS( {"Last 30 Days"}, "Period", [Value] ),
                    GENERATESERIES(DATE(_thisyear, _thismonth, _thisday -30), _today -1)
                ),
                "Axis Date", [Value]
            ),
            //Last60Days
            ADDCOLUMNS(
                GENERATE(
                    SELECTCOLUMNS( {"Last 60 Days"}, "Period", [Value] ),
                    GENERATESERIES(DATE(_thisyear, _thismonth, _thisday -60), _today -1)
                ),
                "Axis Date", [Value]
            ),
            //Last90Days
            ADDCOLUMNS(
                GENERATE(
                    SELECTCOLUMNS( {"Last 90 Days"}, "Period", [Value] ),
                    GENERATESERIES(DATE(_thisyear, _thismonth, _thisday -90), _today -1)
                ),
                "Axis Date", [Value]
            ),
            //LastMonth
            ADDCOLUMNS(
                GENERATE(
                    SELECTCOLUMNS( {"Last Month"}, "Period", [Value] ),
                    GENERATESERIES(DATE (_thisyear, _thismonth -1, 1), EOMONTH( _today,-1) )
                ),
                "Axis Date", [Value]
            )
        ),
        "Date", [Value],
        "Period", [Period],
        "Axis Date", [Axis Date]
    )
3 REPLIES 3
tamerj1
Super User
Super User

Hi @rtmarquee 

would you please asvise the expected result of this table?

The dax above is working as intended. Ideally I would like to be able to add to this dax to also get a selection in the column for the next 90 days, next 6 months, and next year. In our business we enter orders in to our ERP and alot of our business is in the future, so this would help us with projecting for time periods. Thanks!

A rolling time period would be helpful too!

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.