Forum Discussion

Cap91's avatar
Cap91
New Member
1 year ago
Solved

Combining Forecast and Actual Data with Different Time Ranges in One Power BI Visual

Hi everyone, I'm currently working on a Power BI report where I want to display both forecast and actual data in a single visual. However, the two data types should be shown over different time rang...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Cap91,

     

    Thanks for reaching out to the Microsoft Fabric Forum Community.

     

    Try using this measures to show different lines for Actual and forecast values

     

    ActualValue =
    CALCULATE(
    SUM('YourTable'[Value]),
    'YourTable'[DataType] = "Actual",
    DATESINPERIOD('Date'[Date], TODAY(), -100, DAY)
    )


    ForecastValue =
    CALCULATE(
    SUM('YourTable'[Value]),
    'YourTable'[DataType] = "Forecast",
    DATESINPERIOD('Date'[Date], TODAY() + 1, 5, DAY)
    )


    If this helped, please mark the response as the accepted solution and give it a thumbs-up so others can benefit too.

    Best regards,
    Prasanna Kumar