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
Lewa
Helper I
Helper I

Cumulative Sum with crossfilters

Hi all! 

 

I need your help again.

 

So, 

 

Measure = 
VAR FILTER2 = FILTER(ALL(Calendary) ; Calendary[Date] <= MAX(Calendary[Date])) 
VAR FILTER1 = FILTER(ALLSELECTED(Transactions) ; TRUE());
RETURN 
       CALCULATE ( 
                  CALCULATE(SUM(Transactions[Cost]) ; 
                  FILTER2 
       ) ; 
       FILTER1 
)

Im using for cumulative sum FILTER2, but it's not working -- why? 

5 REPLIES 5
danextian
Super User
Super User

Hi @Lewa,

 

There is a Quick Measure feature in Power BI Desktop which can be accessed from the ellipsis that appears when you hover a measure. It can generate a DAX formula similar to below:

 

 

CALCULATE (
    SUM( 'PMBudgetMonitor'[Cost] ),
    FILTER (
        ALLSELECTED ( 'Dates'[Date] ),
        ISONORAFTER ( 'Dates'[Date], MAX ( 'Dates'[Date] ), DESC )
    )
)

Also, a well-structured question with sample data and expected output can get a better response and possibly a faster resolution.  

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Ashish_Mathur
Super User
Super User

Hi,

 

Please explain the question.  Share a dataset and show the expected result.


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

@Ashish_Mathur Hi, 

 

share -- sample pbix, where: 

FILTER1 = required filter

FILTER2 = cumulative filter

 

Problem is: 

without FILTER1 its work correct, 
2.PNG

 

 

 

 

 

 

with -- nope. 
1.PNG

 

 

 

 

 

Hi,

 

I still do not understand the question.  Please explain the business question and show your expected result.


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

@Ashish_Mathur

 

share -- sample pbix, where: 

filter1 = required filter

filter2 = cumulative sum

 

without filter1 its work correct, with -- nope <its problem!>. 

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.