Forum Discussion

MickeLearnPBI's avatar
2 years ago
Solved

Count ongoing values for this year and before

I have created a column that brings up the number of ongoing cases, using True (which is the Ongoing column)

Measurement value
= COUNTAX(ALLSELECTED(Cases), [Ongoing]) +0

When I use my slicer, it only looks at, for example, the year 2023, but I want it to also include previous years' ongoing cases. For example, the case may have started on 2022-12-31, and then it may still be ongoing and should be included in future counts.

 

I am a little lost right now and hope for assistance in this.

  • xifeng_L's avatar
    xifeng_L
    2 years ago

    MickeLearnPBI 

     

    You can try below two measurre.

     

     

     

    Ongoing cases = CALCULATE(COUNT('Executions'[ExecutionID]),'Calender'[Date]<=MAX('Calender'[Date]),'Executions'[Ongoing case]="TRUE")
    
    
    
    Ongoing cases 2 = COUNTAX(FILTER(ALL(Executions),Executions[ExecutionStartDate]<=MAX(Calender[Date])),[Ongoing case])

     

     

     

    Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

     

    Thank you~

     

7 Replies