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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
itskool
Advocate II
Advocate II

Running total for a measure using two different measures depending on the month

Hi Power BI community, 

 

My situation is following:

I have forecast and actual values, I nees to show actuals for past month and forecast for future month.

For that I created a column in my DimMonths table to identify is the month is in the past or in the future and created measure, which works fine.

Forecast/actuals hours =
IF(
    AVERAGE(DimMonths[Future Month?]) = 0,
    [Actuals hours],
    [Forecast hours w/o generic roles]
    )
 
However, the problem starts when I try to calculate the running total - this measure only sums up the forecast values, also from the past months:
Forecast/actuals hours RT = CALCULATE (
    [Forecast/actuals hours],
    FILTER (
        ALLSELECTED(  DimMonths ),
        DimMonths[Month Sort] <= MAX ( DimMonths[Month Sort] )
    )
)
 
I understand this is because of this part of the first formula: AVERAGE(DimMonths[Future Month?]) = 0,
but I have no idea how to fix it.
 
Does anyone have any ideas or had a similar case?
1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors