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
corange
Post Patron
Post Patron

Cumulative not carrying over when no purchase

Hi everyone, 

 

I am struggling with one of my report. I don't understand why it is not showing up the right results. 

 

I need to calculate points accrued for a client. Points are accrued each month and carried over if any left. 

 

For this, I have used a cumulative measure as follows: 

 

Cumulative Points = IF(ISBLANK(SUMX(test1,test1[Nber of Job])), BLANK(), CALCULATE(SUMX(test1,test1[Nber of Job]),FILTER(all('Calendar'),'Calendar'[SingleDate]<=max('Calendar'[SingleDate]))))

 

Then I use the following to know how many vouchers I need to give away (1 voucher for every 150 points). 

 

Tickets Current = QUOTIENT([Cumulative Points],150) 
 
To know exactly how many voucher I need to give for any given month, I deduct the number of voucher they have received the previous month as I use a cumulative measure to make sure I take into consideration carry over points. 
 
Ticket to get = ([Tickets Current]-[Tickets Last Month])
 
**Tickets last month = (CALCULATE([Tickets Current], DATEADD('Calendar'[SingleDate], -1, MONTH)))
 
The below are the results I obtained:
Capture.JPG
 
 

I don't understand why the cumulative is not showing up for Jan. The client didnt make any purchase that month but I thought it will still carry over? Also I don't understand the -18 in Jan or 18 in March. With the cumulative results adding up for January even thought the client didnt purchase, will give me the right results for the voucher. 

 

Can someone please help with the formula to fix this? 

 

You can access the pbix file here if that can be useful: https://1drv.ms/u/s!AiS7XVNuQsBCfLR3YfEnr4wJxEo?e=fM0NE4 

 

Thank you. 

 

 

 

 

 
 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Is this the result you are expecting?  Download the PBI file from here.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Is this the result you are expecting?  Download the PBI file from here.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish, 

 

Thank you so much. Exactly what I was after. 

 

Thanks. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
synergised
Resolver II
Resolver II

This might get you a little further.

 

1.  Calendar - mark this as a date table

 

2.  Sample formula

 

Cumulative_Actual =
CALCULATE (
SUM ( 'Client'[Nber of Job] ),
filter( ALL ( 'Calendar' ),
'Calendar'[SingleDate] <= MAX( 'Calendar'[SingleDate] ))
)
 
 

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.