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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mark_carlisle
Advocate IV
Advocate IV

Semi additive last balance to close date

I have the following table...

 

mark_carlisle_4-1679400377259.png

 

 

I have used the following guide Semi-additive calculations – DAX Patterns to create a measure to show me the last forecast_amount_average_contract_value by pipeline_journey_id up to the forecast close date.

 

Average Contract Value | ACV - Forecast Use Only = 
VAR __max_date =
    MAX ( dim_date[date] )

VAR __max_balance_dates =
    CALCULATETABLE (
        ADDCOLUMNS (
            SUMMARIZE ( fact_pipeline_events_forecast, fact_pipeline_events_forecast[pipeline_journey_id] ),
            "@MaxBalanceDate", CALCULATE ( MAX ( fact_pipeline_events_forecast[forecast_event_date] ) )
        ),
        dim_date[date] <= __max_date,
        fact_pipeline_events_forecast[forecast_close_date] >= __max_date
    )
VAR __max_balance_dates_with_lineage =
    TREATAS ( __max_balance_dates, fact_pipeline_events_forecast[pipeline_journey_id], dim_date[date] )
VAR __result =
    CALCULATE ( SUM ( fact_pipeline_events_forecast[forecast_amount_average_contract_value] ), __max_balance_dates_with_lineage )
RETURN
    __result

 

This just about does what I want it to, in that it projects up to the close date

 

mark_carlisle_1-1679399963987.png

 

But this projects the ACV to the max close date. I want it to return the following 

 

mark_carlisle_3-1679400097764.png

 

This is based on the latest close date for each journey, rather than the max close date for each journey.

 

How can I amend the measure or the table, through a calculated column, to achieve this?

2 REPLIES 2
Anonymous
Not applicable

Hi @mark_carlisle ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure. 

Average Contract Value | ACV - Forecast Use Only = 
VAR MaxBalanceDates =
    ADDCOLUMNS (
        SUMMARIZE (          
           'fact_pipeline_events_forecast',         
            'fact_pipeline_events_forecast'[pipeline_journey_id]
        ),
        "@MaxBalanceDate", CALCULATE (    
            MAX ( fact_pipeline_events_forecast[forecast_event_date]  )        
        )
    )
VAR MaxBalanceDatesWithLineage =
    TREATAS (                
        MaxBalanceDates,     
         'fact_pipeline_events_forecast'[pipeline_journey_id],      
        'dim_date'[Date]        
    )
VAR Result =
    CALCULATE (
        SUM ('fact_pipeline_events_forecast'[forecast_amount_average_contract_value]),
        MaxBalanceDatesWithLineage
    )
RETURN
    Result

(3) Then the result is as follows.

vtangjiemsft_1-1679970516901.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Thanks for the response @Anonymous. However the solution is incomplete. I've adjusted the dates some of the events so theres no data for a pipeline_journey_id in some months. See the values highlighted below for changes.

 

mark_carlisle_0-1680683043892.png

 

This gives the following.

 

mark_carlisle_3-1680683320731.png

But I want to achieve the following

 

mark_carlisle_2-1680683249368.png

 

So for months where theres no data the last known value needs to be populated.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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