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

DAX code to calculate Remaining Revenue

Hi Everyone

 

I need help with a DAX code to calculate the Remaining Forecast Revenue.

To get to this calcualtion I need to Calculate the Actuals up until July 2022 and add the Revenue Forecast amounts from 01 Aug 2022 onwards.

i.e Actuals To Date + Revenue Forecast from following month onward

FlightofICARUS_0-1661438990239.png

Both columns exist in the same table (ProjectOverview) and has a relationship to a Date Dimension table (BS_Calendar).

Thanks in advance


1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @FlightofICARUS ,

 

Please try:

Measure =
VAR _actual =
    SUMX (
        FILTER ( ALL ( ProjectOverview ), [Date] <= MAX ( 'BS_Calendar'[Date] ) ),
        [Actuals]
    )
VAR _forecast =
    SUMX (
        FILTER ( ALL ( ProjectOverview ), [Date] > MAX ( 'BS_Calendar'[Date] ) ),
        [Forecast]
    )
RETURN
    IF (
        MAX ( 'BS_Calendar'[Date] ) <= DATE ( 2022, 7, 1 ),
        BLANK (),
        _actual + _forecast
    )

Final output:

vjianbolimsft_0-1661763349415.png

Best Regards,

Jianbo Li

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

View solution in original post

2 REPLIES 2
FlightofICARUS
Frequent Visitor

Hi Thank you for the reply, it wasn't exactly what I needed but it guided me in the right direction 🙂

v-jianboli-msft
Community Support
Community Support

Hi @FlightofICARUS ,

 

Please try:

Measure =
VAR _actual =
    SUMX (
        FILTER ( ALL ( ProjectOverview ), [Date] <= MAX ( 'BS_Calendar'[Date] ) ),
        [Actuals]
    )
VAR _forecast =
    SUMX (
        FILTER ( ALL ( ProjectOverview ), [Date] > MAX ( 'BS_Calendar'[Date] ) ),
        [Forecast]
    )
RETURN
    IF (
        MAX ( 'BS_Calendar'[Date] ) <= DATE ( 2022, 7, 1 ),
        BLANK (),
        _actual + _forecast
    )

Final output:

vjianbolimsft_0-1661763349415.png

Best Regards,

Jianbo Li

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

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