Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MickeLearnPBI
Helper I
Helper I

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.

1 ACCEPTED SOLUTION

@MickeLearnPBI 

 

You can try below two measurre.

 

xifeng_L_0-1717290095768.png

xifeng_L_1-1717290108482.png

 

 

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~

 

View solution in original post

7 REPLIES 7
xifeng_L
Super User
Super User

Hi @MickeLearnPBI 

 

Since you didn't provide example data, I can only give a rough result, just for reference.

 

Measure = COUNTAX(FILTER(ALL(Cases),Case[Date]<=MAX(Slicer[Date])),[Ongoing])

 

 

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

 

Thank you~

Can I add a file here?

Thx!
Here is the sample file.
Cases - Power BI 

@MickeLearnPBI 

 

You can try below two measurre.

 

xifeng_L_0-1717290095768.png

xifeng_L_1-1717290108482.png

 

 

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~

 

Great! That worked!
One last question:
Can the result be adjusted according to another slicer that I have belonging to the same table (Executions) with column (TypeOfCase).

The dax form I use today is

COUNTAX(ALL(Executions), [Ongoing case]) +0

Since the ALL function ignores any filters, it needs to be contextualized to decide on a solution

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.