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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KH11NDR
Helper IV
Helper IV

Rolling calculated totals

calc model excel.PNG

5 REPLIES 5
v-jiascu-msft
Employee
Employee

Hi @KH11NDR,

 

What does your raw data look like? I would suggest you create a date table first and try the formula below.

Measure =
VAR previousEstimate =
    CALCULATE ( SUM ( Table1[Estimate] ), PREVIOUSMONTH ( 'Calendar'[Date] ) )
RETURN
    IF (
        MIN ( Table1[Estimate] ) = 0,
        SUM ( Table1[Actual] ),
        IF (
            previousEstimate = 0,
            MIN ( Table1[Estimate] )
                - CALCULATE (
                    SUM ( Table1[Actual] ),
                    FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] < MIN ( 'Calendar'[Date] ) )
                ),
            MIN ( Table1[Estimate] ) - previousEstimate
        )
    )

Rolling_calculeted_totals

 

Best Regards,

Dale

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

Wow, 

 

Thanks Dale, I'm new to this and now I know how important it is to show your data model exactly how it is, You've  got it working 100% as expected, It's my fault, In my model I have Estimate as down as a column, it's actually a calculated measure and when I do your measure, I get an error here "PREVIOUSMONTH('Master Calendar'[Date])".  Totally my fault, for not saying Estimate was a measure.  I hope it's a quick fix, as I can't work it out, but I'm working on it.

 


Measure 11 =
var previousRevenue =
CALCULATE([Total to Earn - % Complete of Project]),PREVIOUSMONTH('Master Calendar'[Date]))
return
if (
min ( [Total to Earn - % Complete of Project] ) = 0,
sum( 'Calc Numbers'[Previous Revenue Submitted (£) - Original]),

if( previousRevenue = 0,
min([Total to Earn - % Complete of Project])
- CALCULATE(sum('Calc Numbers'[Previous Revenue Submitted (£) - Original]),
FILTER(ALL('Master Calendar'), 'Master Calendar'[Date] < min ('Master Calendar'[Date]))
),
min([Total to Earn - % Complete of Project]) - previousRevenue

)
)

Hi @KH11NDR,

 

You are welcome. Can you provide more information as I mentioned in the Message?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
KH11NDR
Helper IV
Helper IV

Anyone?

Is this question posted in the wrong forum? is there anywhere else I can post this question?

 

Many Thanks

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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