Forum Discussion
Cumulative count on two different dates columns
- Anonymous4 years ago
Hi klaritak ,
Please refer to my pbix file to see if it helps you.
Create measures.
Cumulative count on date 27.03 = VAR _max_id = CALCULATE ( MAX ( 'Table'[ID] ), FILTER ( ALL ( 'Table' ), 'Table'[Date Created] = DATE ( 2022, 3, 27 ) ) ) RETURN CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALL ( 'Table' ), 'Table'[ID] <= _max_id ) )Cancelled = VAR _created = CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) ) VAR caleled = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALL ( 'Table' ), 'Table'[Date Cancelled] <> BLANK () ) ) RETURN _created - caleledIf I have misunderstood your meaning, please provide the details. Why did you want to calculate Cumulative count on date 2022.03.27.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
klaritak , Join both the dates with date table , Assume one join is inactive assume that is Date Cancelled
Create measures
Created = count(Table[ID])
Cancelled= calculate(count(Table[ID]),USERELATIONSHIP ('Table'[Date Cancelled], 'Date'[Date]), not(isblank('Table'[Date Cancelled])) )
Then create measure
Cumm Sales = CALCULATE([Created] - [Cancelled],filter(allselected(date),date[date] <=max(date[Date])))
use date from date table in visual and slicer
Also check - https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
Hey amitchandak,
Thank you very much for your reply.
This formula is not working: Cancelled= calculate(count(Table[ID]),USERELATIONSHIP ('Table'[Date Cancelled], 'Date'[Date]), not(isblank('Table'[Date Cancelled])))
I get the following error (Too many arguments were passed to the USERELATIONSHIP function. The maximum argument count for the function is 2.)