cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
toddpbi Regular Visitor
Regular Visitor

Trying to show cumulative running total in grand total cell

Hello PBI community,

Currently I have the following measure in place which performs a standard budget allocation over the number of days in the month for each day. I am trying to show the running grand total in the pivot grand total cell, however, I am continuing to get a blank although I want to show the final date value (the running total) as part of grand total cell.

My current measure is:

SR YTD Targets =

VAR
LastNonBlankValue =
CALCULATE (
      MAX ( DIM_Dates[Date] ) )
      
VAR
BudgetAllocations =
IF (
    MAX ( DIM_Dates[Date] ) > TODAY(), BLANK(),
    CALCULATE (
    SUMX (
    SUMMARIZE (
        FILTER (
            DIM_Dates,
            DIM_Dates[Year] > 2017
        ),
        DIM_Dates[Date], "Budgets", [SR Target Allocation]
        ),
        [Budgets]
        ),
    FILTER (
        ALLSELECTED ( DIM_Dates ),
        DIM_Dates[Date] <= MAX ( DIM_Dates[Date] )
    )
)
)

VAR
TotalYTDTargets =
CALCULATE ( [All Targets],
    FILTER (
        ALL ( DIM_Dates ),
        DIM_Dates[Year] > 2017
    ),
    DIM_Dates[Date] <= TODAY() )
    
RETURN
IF (
    HASONEVALUE ( DIM_Dates[Date] ),
    BudgetAllocations,
    CALCULATE (
        BudgetAllocations,
        ALLSELECTED ( DIM_Dates[Date] ),
        DIM_Dates[Date] = LastNonBlankValue
    )
)

Can anyone see why my code is displaying a blank value? I need it to show the last non-blank date in the current context, which would be the total on the 6/4/2018 (9,224,857,148)

 

Any help would be greatly appreciated in order to acheive this in the grand total.

 

2018-06-14_11h01_52.png

1 REPLY 1
Community Support Team
Community Support Team

Re: Trying to show cumulative running total in grand total cell

Hi @toddpbi

I make a test with your measure, but can’t reproduce your issue.

In the table,” All Targets”, “SR Target Allocation” and “SR YTD Targets” are measures.

I’m afraid your dataset is not like this, could you give some example for better analysis.

3.png

 

Best Regards

Maggie

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 41 members 933 guests
Please welcome our newest community members: