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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
nr63bi
Helper I
Helper I

Cumulative data on a period

Hello,

 

I have a problem with Power BI, 

 

I use a table like this

 

1/01 1

1/01 1

2/01 1

5/01 -1

 

And I  want to make a cumulate value like this 

 

1/01 2

2/01 3

5/01 2

 

I use this DAX function

 

CALCULATE(
    SUM('transitions_state'[Submitted]),
    FILTER(
        ALLSELECTED('transitions_state'[Data.ChangedDate]),
        ISONORAFTER('transitions_state'[Data.ChangedDate], MAX('transitions_state'[Data.ChangedDate]), DESC)
    )
)
 
 
And it works with my data
 
nr63bi_0-1698242923784.png

But when I use the date slicer, for exemple focus on 3/03 and 16/03 , i have this

 

nr63bi_1-1698242984065.png

 

I want that when i use date slicer, the data focus on the date selected but not affect the values. How can i do this ? 

 

Thank you in advance 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nr63bi ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1698400325503.png

Date:

Date = CALENDAR(FIRSTDATE('Table'[Date]),LASTDATE('Table'[Date]))

vbinbinyumsft_1-1698400396905.png

Model:

vbinbinyumsft_2-1698400587418.png

2. create a measure with below dax formula

Measure =
VAR cur_date =
    SELECTEDVALUE ( 'Table'[Date] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Date] <= cur_date )
RETURN
    SUMX ( tmp, [Value] )

3.  add a table visual with Table field and measure, add a slicer visual with Date table field

Animation31.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @nr63bi ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1698400325503.png

Date:

Date = CALENDAR(FIRSTDATE('Table'[Date]),LASTDATE('Table'[Date]))

vbinbinyumsft_1-1698400396905.png

Model:

vbinbinyumsft_2-1698400587418.png

2. create a measure with below dax formula

Measure =
VAR cur_date =
    SELECTEDVALUE ( 'Table'[Date] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Date] <= cur_date )
RETURN
    SUMX ( tmp, [Value] )

3.  add a table visual with Table field and measure, add a slicer visual with Date table field

Animation31.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

You do that by using a disconnected table to feed your slicer.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.