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 count with several entries for same date

Hello Power BI geniuses (and people with the same issue as me...)

 

I am trying to write a measure to give me a cumulative count over a period of time, using this:

Cumulative stuff = CALCULATE(COUNTA('My Table'[stuff I want to count]),FILTER('My Table'),('DateTable'[Date])<=today()))

 

 

The problem is, in My Table, I can have more than one row for a single date:

My Table - DateStuff i want to count
28-Dec-17A
01-Feb-18B
22-Feb-18C
07-Mar-18D
09-Mar-18E
10-Mar-18F
11-Mar-18G
11-Mar-18H
15-Mar-18I
15-Mar-18J

 

And I get an error message telling me "a single value for the column date cannot be determined..."

I've tried grouping my table per date and and count of rows, but it doesn't seem to solve the issue.

My date table was creating using Date =CALENDAR (DATE(2000;1;1); DATE(2025;12;31)) AND i manually checked, I don't have any duplicates in that table 😕

 

Can anybody suggest a solution?

Thanks in advance 😄

 

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Please refer to this measure:

Cumulative stuff =
CALCULATE (
    COUNT ( 'My Table'[Stuff] ),
    FILTER ( ALL ( 'My Table' ), 'My Table'[Date] <= TODAY () )
)

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

Thank you sooooo much for taking the time (I'm going crazy) - the error message is gone but I must be doing something wrong because it gives me the same value for each date (looks like it's the total count of [stuff]). How do I get it to give me the cumulative count for each day?

 

Initial table

My Table - DateStuff
28-Dec-17A
01-Feb-18B
22-Feb-18C
07-Mar-18D
09-Mar-18E
10-Mar-18F
11-Mar-18G
11-Mar-18H
15-Mar-18I
15-Mar-18J

 

What I see now:

My Table - DateCumulative count
28-Dec-1710
01-Feb-1810
22-Feb-1810
07-Mar-1810
09-Mar-1810
10-Mar-1810
11-Mar-1810
15-Mar-1810

What I'd like to see:

My Table - DateCumulative count
28-Dec-171
01-Feb-182
22-Feb-183
07-Mar-184
09-Mar-185
10-Mar-186
11-Mar-188
15-Mar-1810

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.