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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jfn
Frequent Visitor

To forecast, data cannot have empty values

My graph used to forecast fine, but now, after updating the dataset, I have the following error: "to forecast, data cannot have empty values". I'm not sure how to approach this one. I would like to forecast up to 2026, but it seems I have an empty field (see image below). The Y axis is coming from a measure, the code is shown below. The X axis is a calendar that was generated from 2021 to 2026. Any help would be super appreciated! Thanks

 

 

Remaining Tokens02 = 
VAR __StartingTokens = 375802 
VAR __MaxDate = MAX('Date Table'[StartDate])
RETURN
    __StartingTokens - 
    CALCULATE(
        SUM(Token2021[Credits]),
        'Date Table'[StartDate] <= __MaxDate,
        ALL(Token2021[StartDate])
    )

 

 

I want the forecast back (was very nice!)I want the forecast back (was very nice!)I this this empty field is the culpritI this this empty field is the culprit

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @jfn ,

I think this may be caused by relationship between tables, try to modify the formula like this:

Remaining Tokens02 =
VAR __StartingTokens = 375802
VAR __MaxDate =
    MAX ( 'Date Table'[StartDate] )
RETURN
    IF (
        MAX ( [StartDate] ) <> BLANK (),
        __StartingTokens
            - CALCULATE (
                SUM ( Token2021[Credits] ),
                'Date Table'[StartDate] <= __MaxDate,
                ALL ( Token2021[StartDate] )
            )
    )

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

With this formulae, I still have an empty row (pic below)... Not sure if this is related, but here's how I generated the dates (for reference).

Capture.JPG

 

 

Date Table = CALENDAR(DATE(2021,01,01),TODAY())

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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