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! Learn more

Reply
JoaoLucas
Frequent Visitor

Forecast Sum in Line Chart

Hi Power Bi Community, 

I'm wondering if it's possible to sum all forecast values projected in a line chart. Because our business is based on forecast analysis, we needed to know the cumulative value for the period we selected in the chart.

I searched the web for this topic but did not find a solution.

JoaoLucas_0-1671024978480.png

*Consider the image as an example

Do you have any suggestions for a solution?

Thanks in advance!

6 REPLIES 6
JoaoLucas
Frequent Visitor

I realized. But I'm looking for something else. Consider the following scenario:

Make a Line Chart with a 1-year forecast.

JoaoLucas_1-1671026661375.png


I'd like to have a Card that displays the total value of the Forecast generated by the visual.
Is there a Dax Measure that can do it?

Anonymous
Not applicable

HI @JoaoLucas,

You can extract the current category and use the current date value to get the previous date value, then you can use these values as forecast values.

If you are confused about coding formula, can you please share some dummy data that keep the raw data structure with expected results? They should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Thanks for your help! 
You can find the data extracted from the visual here as a sample.

DateValueforecastValueconfidenceHighBoundconfidenceLowBound
01/01/20185560782   
01/02/20183077646   
01/03/20184653840   
01/04/20184166852   
01/05/20184439928   
01/06/20184056547   
01/07/20184074802   
01/08/20184534955   
01/09/20183103308   
01/10/20185365654   
01/11/20185492045   
01/12/20186941048   
01/01/20198064877   
01/02/20194390242   
01/03/20195534477   
01/04/20196432866   
01/05/20196474449   
01/06/20195135766   
01/07/20196921033   
01/08/20196845774   
01/09/20196783686   
01/10/20195975929   
01/11/20196078076   
01/12/20195082973   
01/01/20206326392   
01/02/20205266328   
01/03/20207984761   
01/04/20207365550   
01/05/20206177771   
01/06/20207303232   
01/07/20206530612   
01/08/20205644700   
01/09/20206955484   
01/10/20206755124   
01/11/20208177077   
01/12/20206920522   
01/01/202111401846   
01/02/20217538232   
01/03/20218910501   
01/04/20219681911   
01/05/20219622167   
01/06/20218805337   
01/07/20218589440   
01/08/20219336723   
01/09/20219722110   
01/10/202110424050   
01/11/20217504885   
01/12/20217341516   
01/01/20229840748   
01/02/202210170544   
01/03/202213355300   
01/04/202210935093   
01/05/202211273224   
01/06/202211190323   
01/07/20229705778   
01/08/202210738521   
01/09/202213157338   
01/10/202211310213   
01/11/202281498578149856,8358149856,8358149856,835
01/12/2022 10611893,6312842511,788381275,481
01/01/2023 12981816,8915212439,9610751193,82
01/02/2023 10543374,8812774003,358312746,412
01/03/2023 12430691,9514661326,3210200057,58
01/04/2023 12363177,1614593817,9510132536,36
01/05/2023 12031615,6814262263,449800967,916
01/06/2023 11826210,514056865,89595555,196
01/07/2023 11881125,1714111788,69650461,734
01/08/2023 11941810,7514172482,939711138,574
01/09/2023 12249748,6714480430,2310019067,12
01/10/2023 12382181,6114612873,210151490,02
01/11/2023 12097933,8614328636,179867231,551
01/12/2023 12142894,5414391851,849893937,244
Anonymous
Not applicable

HI @JoaoLucas,

I'm not so clear how your sample forecast data calculate. As I said, you can use current date to look up previous year data as forecast.

forecast=
VAR currDate =
    MAX ( Table[Date] )
RETURN
    CALCULATE (
        SUM ( Table[Value] ),
        FILTER (
            ALLSELECTED ( Table ),
            [Date]
                = DATE ( YEAR ( currDate ) - 1, MONTH ( currDate ), DAY ( currDate ) )
        )
    )

For high bound and lower bound, you can summary previous records to get the max and min result:

HighBound =
VAR currDate =
    MAX ( Table[Date] )
VAR summary =
    SUMMARIZE (
        FILTER ( ALLSELECTED ( Table ), [Date] < currDate ),
        [Date],
        "Total", SUM ( Table[Value] )
    )
RETURN
    MAXX (
        FILTER ( summary, FORMAT ( [Date], "mmm/dd" ) = FORMAT ( currDate, "mmm/dd" ) ),
        [Total]
    )

LowBound =
VAR currDate =
    MAX ( Table[Date] )
VAR summary =
    SUMMARIZE (
        FILTER ( ALLSELECTED ( Table ), [Date] < currDate ),
        [Date],
        "Total", SUM ( Table[Value] )
    )
RETURN
    MINX (
        FILTER ( summary, FORMAT ( [Date], "mmm/dd" ) = FORMAT ( currDate, "mmm/dd" ) ),
        [Total]
    )

Regards,

Xiaoxin Sheng

The sample forecast was calculated in line chart visuals using the Algoritheme from Power BI. 

The chart has "Date" on the X-Axis and Sales on the Y-Axis. We have each month sales displayed and this PBI function calculates the forecast automatically based on Sales values.

My question is how can i show in a card box the total value for the forecast.
In other words how can i sum the total values in the forecast line generated by PBI (Forecast Value, Upper Bound and Lower Bound

JoaoLucas_0-1672391779512.png

amitchandak
Super User
Super User

@JoaoLucas , I doubt you can do much with this forecast value.

You can create a cumulative visual, in that case forecast will also be cumulative

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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