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
Anonymous
Not applicable

Accumulate values by several dimensions

Hello data warriors! 

I've been trying to solve a problem that is  using a measure that accumulates revenue based on month, day and year. Basically I want to use it in a bar chart with drilldowns, each drilldown will change the dimension, so I intend to make the measure adapt to the dimension shown. 

 

This chart below already shows a measure accumulating only by month, I want transform it into these three dimensions I mentioned. 

 

 


printzin.PNG

So I tried using this expression:

 

Accumulated =
CALCULATE(
    [06M - Revenue];
    FILTER(
        CALCULATETABLE(
            SUMMARIZE('Cupom'; 'Cupom'[Month Number]; 'Cupom'[Month Name]; Cupom[Year]; Cupom[Day]);
            ALLSELECTED('Cupom')
        );
        ISONORAFTER(
Cupom[Month Number];MAX(Cupom[Month Number]);DESC;
Cupom[Month Name];MAX(Cupom[Month Name]);DESC;
Cupom[Year];MAX(Cupom[Year]);DESC;
Cupom[Day];MAX(Cupom[Day]);DESC
 
        
 
        )
    )
)



But it didn't bring right values. Can someone give me a guidance? Sorry if I weren't clear enough.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hey @TeigeGao ,

Sorry, what I tried to meant is that the bar chart when the user change the levels of drilldown, it changes based on the dimensions dragged in the object(which is: month, year, day).

I manage to solve that using another measure that makes a decision structure, for instance: 

Month accumulative measure: 

CALCULATE(
    [06M - Revenue];
    FILTER(
        CALCULATETABLE(
            SUMMARIZE('Cupom'; 'Cupom'[Month Number; 'Cupom'[Month Name]);
            ALLSELECTED('Cupom')
        );
        ISONORAFTER(
            'Cupom'[Month Number]; MAX('Cupom'[Month Number]); DESC;
            'Cupom'[Month Name]; MAX('Cupom'[Month Name]); DESC
        )
    )

Year Accumulative Measure: 
CALCULATE(
    [06M - Revenue];
    FILTER(
        ALLSELECTED('Cupom'[Year]);
        ISONORAFTER('Cupom'[Year]; MAX('Cupom'[Year]); DESC)
    )
)
Day Accumalitive Measure:
CALCULATE(
    [06M - Revenue];
    FILTER(
        ALLSELECTED('Cupom'[Day]);
        ISONORAFTER('Cupom'[Day]; MAX('Cupom'[Day]); DESC)
    )
)

So I created this last measure that verifies if inside the drilldown each one is being filtered, so it accumulates based on what the measure calculates:
Accumulative Activation:
F(
ISFILTERED(Cupom[Month Name); [Month Accumulative Measure];
IF(
ISFILTERED(Cupom[Year]);[Year Accumulative Measure];
IF(
ISFILTERED(Cupom[Day]); [Day Accumulative Measure];0)
))
Hope you understand.






View solution in original post

2 REPLIES 2
TeigeGao
Solution Sage
Solution Sage

Hi @Anonymous ,

Could you please share some sample data and expected result to us for analysis? It's sorry that I can't understand your requirement well. 

As you mentioned above, "each drilldown will change the dimension", the filter cannot change the dimension, it can only filter data in this dimension.

Best Regards,

Teige

Anonymous
Not applicable

Hey @TeigeGao ,

Sorry, what I tried to meant is that the bar chart when the user change the levels of drilldown, it changes based on the dimensions dragged in the object(which is: month, year, day).

I manage to solve that using another measure that makes a decision structure, for instance: 

Month accumulative measure: 

CALCULATE(
    [06M - Revenue];
    FILTER(
        CALCULATETABLE(
            SUMMARIZE('Cupom'; 'Cupom'[Month Number; 'Cupom'[Month Name]);
            ALLSELECTED('Cupom')
        );
        ISONORAFTER(
            'Cupom'[Month Number]; MAX('Cupom'[Month Number]); DESC;
            'Cupom'[Month Name]; MAX('Cupom'[Month Name]); DESC
        )
    )

Year Accumulative Measure: 
CALCULATE(
    [06M - Revenue];
    FILTER(
        ALLSELECTED('Cupom'[Year]);
        ISONORAFTER('Cupom'[Year]; MAX('Cupom'[Year]); DESC)
    )
)
Day Accumalitive Measure:
CALCULATE(
    [06M - Revenue];
    FILTER(
        ALLSELECTED('Cupom'[Day]);
        ISONORAFTER('Cupom'[Day]; MAX('Cupom'[Day]); DESC)
    )
)

So I created this last measure that verifies if inside the drilldown each one is being filtered, so it accumulates based on what the measure calculates:
Accumulative Activation:
F(
ISFILTERED(Cupom[Month Name); [Month Accumulative Measure];
IF(
ISFILTERED(Cupom[Year]);[Year Accumulative Measure];
IF(
ISFILTERED(Cupom[Day]); [Day Accumulative Measure];0)
))
Hope you understand.






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.