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
toddpbi
Helper II
Helper II

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
v-juanli-msft
Community Support
Community Support

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
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.