cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
QS7
Frequent Visitor

Cumulated total not working properly with filter

Hi erveryone, 
I have an issue with a Cumulated total measure, the measure is the following :

 

CALCULATE(
	SUM('Sales'[Number of sales]),
	FILTER(ALLSELECTED('Sales'[Date]) ,'Sales'[Date]<=MAX('Sales'[Date])
))

 

The measure is working as long i'm not trying to filter my datas, when i do ( For exemple when i'm filtering on all the sales > 0$, which is always the case ), the measure is not cumulating anymore and results in something like this :

DateNumbers of sales
01/03/202156
02/03/202154
03/03/202178
04/03/202180
05/03/20210
06/03/202165


Does anyone have an idea where the problem might come from ?
Thanks !

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@QS7 , The date you are using should be the date from sales in visual

 

try like

 

CALCULATE(
	SUM('Sales'[Number of sales]),
	FILTER(ALLSELECTED('Sales') ,'Sales'[Date]<=MAX('Sales'[Date])
))

 



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@QS7 , The date you are using should be the date from sales in visual

 

try like

 

CALCULATE(
	SUM('Sales'[Number of sales]),
	FILTER(ALLSELECTED('Sales') ,'Sales'[Date]<=MAX('Sales'[Date])
))

 



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Ignite 2022

What's Next at Microsoft Ignite 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Top Solution Authors
Top Kudoed Authors