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
Stuznet
Helper V
Helper V

Show Cumulative Running Total From Previous and current month

Hi all, 

 

I'm currently struggling to get this data to show up on the current month, not the whole 12 months.

 

Here is my dataset

MonthValueCumulative
January6363
February55118
March30148
April33181
May50231
June60291
July69360
August64424
September60484
October15499
November14513
December13526
 5263838

 

This the formula I created. The total is the sum of Value column,

 

Cumulative = CALCULATE([Total],FILTER(ALLSELECTED('Table1'),''Table1'[Month Num] <= MAX(''Table1'[Month Num])))

So how do I get it to display from January to current month? 

 

Thanks 🙂

 

 

 

1 ACCEPTED SOLUTION

I figured it out how to stop the running total. 

 

Measure = 
VAR Test = CALCULATE([Total] , 
             FILTER(
                    ALLSELECTED(Table1) , 
                    Table1[Month Number] <= MAX(Table1[Month Number])))
RETURN
      IF(MAX(Table1[Month Number]) +1 <= MONTH(TODAY()),
         Test, BLANK())

 

View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @Stuznet,

 

Not really sure on the rest of the model and if you have date instead of month names, but looking at your data and if you want it to have the value until current month without the selection of any slicer you should redo your measure to something like this:

 

Cumulative =
CALCULATE (
    [Total],
    FILTER ( ALLSELECTED ( 'Table1' ), 'Table1'[Month Num] <= MONTH ( TODAY () ) )
)

Again your data is insuficient to test with your setup but should work.

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelixThe formula you provided doesn't give me the correct result. It basically sum the total from Jan to oct and displaying the total in the column. 

 

On my original data I do not have any date which make it difficult for me to create a date table. (Any suggestion?)

The only date I have is the Month Names table. I added an index column as a Month Number. 

 

I would like to display the data from January to present month. So the next data dump, will be automatically show up on the chart and without selection of any slicer. 

I figured it out how to stop the running total. 

 

Measure = 
VAR Test = CALCULATE([Total] , 
             FILTER(
                    ALLSELECTED(Table1) , 
                    Table1[Month Number] <= MAX(Table1[Month Number])))
RETURN
      IF(MAX(Table1[Month Number]) +1 <= MONTH(TODAY()),
         Test, BLANK())

 

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.