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

cumulative sum issue

Hi, I have the following problem: I have used the following measure to calculate the cumulative sum:

 

This should be the sum of entries in the table: 

 
mit IV = DISTINCTCOUNT(Kunde[amsidnr])
And this should be the cumulative sum:
 
IV =
CALCULATE (
KUNDE[mit IV];
FILTER(
ALL(KUNDE[INSERTDATE].[Date]);
KUNDE[INSERTDATE].[Date] <= MAX(KUNDE[INSERTDATE].[Date])))
 
The formula works fine, but when I use the measure in a graph it shows me all the upcoming months for this year with the value being the same. I only want to see the graph for the monthsuntil now. The slicers don't seem to work. I have no data for the months after January 2019. 
1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

This measure should work.

IV = 
CALCULATE (
KUNDE[mit IV],
FILTER(
ALLSELECTED(KUNDE),
KUNDE[INSERTDATE] <= MAX(KUNDE[INSERTDATE])
))

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

21 REPLIES 21
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

This measure should work.

IV = 
CALCULATE (
KUNDE[mit IV],
FILTER(
ALLSELECTED(KUNDE),
KUNDE[INSERTDATE] <= MAX(KUNDE[INSERTDATE])
))

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-yulgu-msft Thanks!

themistoklis
Community Champion
Community Champion

@Anonymous

 

At the graph do you use the date field from a custom calendar?

 

If yes then you need to use the date field from the actual table

Anonymous
Not applicable

@themistoklis

I use the date field from my table. 

@Anonymous

 

If you dont have data after Jan 2019 how do you see the following months then??

 

Any chance to share your file with us?

@Anonymous

 

Following my previous message you can add another parameter on your filter section:

 

IV =
CALCULATE (
KUNDE[mit IV];
FILTER(
ALL(KUNDE[INSERTDATE].[Date]);
KUNDE[INSERTDATE].[Date] <= MAX(KUNDE[INSERTDATE].[Date]) &&
MONTH(KUNDE[INSERTDATE]) <= MONTH(TODAY()) 
)
)
Anonymous
Not applicable

@themistoklis

thank you for the reply but your formula only returns the values for all januarys. I created another table with sample data that i would like to share here but i don´t know how to upload it. Sorry I am new can you please help with that too.

@Anonymous

 

either use dropbox or onedrive and share it  ... or you can even upload the file on a website (e.g. wetransfer.com) and send the link to us

Anonymous
Not applicable
Anonymous
Not applicable

@themistoklis there it is

@Anonymous

 

Remove the .Date from your DAX formula. It should be like this:

 

IV = 
CALCULATE (
KUNDE[mit IV],
FILTER(
ALL(KUNDE[INSERTDATE]),
KUNDE[INSERTDATE] <= MAX(KUNDE[INSERTDATE])
))
Anonymous
Not applicable

@themistoklis

it doesn´t work. If I do that it doesn´t show a cumulative sum anymore

@Anonymous

 

I sent another message where i made one more change to the DAX formula.

This one does show the cumulative sum.

 

Posting it again:

IV = 
CALCULATE (
KUNDE[mit IV],
FILTER(
ALL(KUNDE),
KUNDE[INSERTDATE] <= MAX(KUNDE[INSERTDATE])
))

 

Anonymous
Not applicable

@themistoklis

 

thanks it worked for the sample dataset but I am still having trouble in the original one, because some of the INSERTDATE fields are blank. Thanks a lot once again though

Anonymous
Not applicable

@themistoklis

it worked like that:

IV = 
CALCULATE (
  KUNDE[mit IV];
    FILTER(
       ALL(KUNDE);
       KUNDE[INSERTDATE].[Date] <= MAX(KUNDE[INSERTDATE].[Date])))

@Anonymous

 

I have also made one more correction as the above formula doesnt give the cumulative sum:

 

IV = 
CALCULATE (
KUNDE[mit IV],
FILTER(
ALL(KUNDE),
KUNDE[INSERTDATE] <= MAX(KUNDE[INSERTDATE])
))
AlB
Super User
Super User


@Anonymous wrote:
The formula works fine, but when I use the measure in a graph it shows me all the upcoming months for this year with the value being the same. I only want to see the graph for the monthsuntil now. The slicers don't seem to work. I have no data for the months after January 2019. 

 

@Anonymous

What measure are you referring to? You say they are all calculated columns

Anonymous
Not applicable

@AlB I am sorry

 

mit IV and IV are measures

Anonymous
Not applicable

I use IV in a graph with INSERTDATE being the x-axis

AlB
Super User
Super User

Hi @Anonymous

Can you share the pbix? Or at least show the structure of your data model?

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.