Forum Discussion
Calculate cumulative counts
- 9 years ago
Another option:
You'll need a date table, you can use something like this (though you'll just really need the date for this): https://community.powerbi.com/t5/Desktop/How-do-i-create-a-date-table/td-p/23896
On your date table add a column with this formula: OpenIssues = Calculate(Countrows(Table1),Filter(Table1, Table1[Date Opened] <= LASTDATE(DateTable[Date]) && Table1[Date Closed] >= FirstDate(DateTable[Date])))
Gives a result as such with your sample data:
Another option:
You'll need a date table, you can use something like this (though you'll just really need the date for this): https://community.powerbi.com/t5/Desktop/How-do-i-create-a-date-table/td-p/23896
On your date table add a column with this formula: OpenIssues = Calculate(Countrows(Table1),Filter(Table1, Table1[Date Opened] <= LASTDATE(DateTable[Date]) && Table1[Date Closed] >= FirstDate(DateTable[Date])))
Gives a result as such with your sample data:
Here is my adaptation of your formula. Unfortunately it doesnt seem to work for me. I get all rows of the new column with the same value.
OpenIssues = Calculate(Countrows(Issues), Filter(Issues, Issues[Date Opened] <= LASTDATE(DateTable[Date]) && Issues[Date Closed] >= FirstDate(DateTable[Date]) ) )
Can you link your example pbix file so I can take a look through it?
- danrmcallister9 years agoResolver II
Hmmm, did you build your OpenIssues column on the Date table or the Issues table? In this design I built it on the Date table.
I'm new to these forums, how do you upload a file? I'd be happy to email it to you. In lieu of that here are some screenshots with the details:
- jsquaredz9 years agoAdvocate I
I built my openissues column in my date table. Not sure if it matters but my date table is a calculated table.
PS I sent you a PM with my email.
- Sean9 years agoCommunity Champion
To make danrmcallister's column work you need to get rid of the relationship between the tables!
There's even a third way to do this if you are interested...
Which way you go it really depends on how much further analysis you need to do!
Read Anonymous's posts at the above link! :smileyhappy:
BTW
Here's the Active Count formula explained