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
pmcard97
New Member

Cumulative Transaction Count

I have a table of transactions with a transaction date.  I want to create a line graph that displays the cumulative count of transactions.

 

I created a new column as:

 

 

Cumulative Count = CALCULATE(
                    COUNTROWS(master_roster),
                    FILTER( ALLSELECTED(master_roster), 
                            master_roster[enrollmentDate] <= MAX(master_roster[enrollmentDate]) )
            )

 

 

For some reason, the filter does not seem to be working.  Every data row in the table has Cumulative Count = the total number of rows. When I create a line graph with [enrollmentDate] on the Axis and Maximum of [Cumulative Count] in the values I get the total count for all dates.

 

What am I doing wrong?

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@pmcard97

 

Hi,

 

If you are using a calculated column, you need to replace "Max" with "Earlier"

=
CALCULATE (
    COUNTROWS ( master_roster ),
    FILTER (
        master_roster,
        master_roster[enrollmentDate] <= EARLIER ( master_roster[enrollmentDate] )
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi @pmcard97,

 

Show your dataset and the expected result.


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

@pmcard97

 

Hi,

 

If you are using a calculated column, you need to replace "Max" with "Earlier"

=
CALCULATE (
    COUNTROWS ( master_roster ),
    FILTER (
        master_roster,
        master_roster[enrollmentDate] <= EARLIER ( master_roster[enrollmentDate] )
    )
)

Regards
Zubair

Please try my custom visuals

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.