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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
GabrielM
New Member

Count status with conditional dates

Hi, I have a challenge and I need your help.


I have a status log per tasks, in which I have the record of the changes status of each task.

Table.jpg
For example, task "A" goes through states 1, 2 and 3 at such times.
What I want to achieve, is to be able to graph the number of tasks in each state at a certain moment, at a certain moment of time should show the last state of each task before that time.
For example, in the following graph I show the quantities in the table above.

 graph.jpg

The challenge is to be able to explore by month, day and hours and count the status for each time.

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@GabrielM

 

In this scenario, I assume you have a Date/Time to get those certain moments. However, since there's no direct relationship between these certain moments and your source table. You can't include the fields from these two tables into same chart visual.

 

For your requirement, you can only create a slicer for those certain moments, the build a measure to get the last status for each task.

 

Last Status = 
var MaxTime = CALCULATE(MAX(Table3[Time]),FILTER(Table3,Table3[Time]<=MAX(Table4[Time])))
return
CALCULATE(MAX(Table3[Status]),FILTER(Table3,Table3[Time]=MaxTime))

Capture.PNG

 

 

And to calculate the number of tasks for each status, we have to summarize above table into calculated table. However, it's not possible to generate a dynamic table. And we can't assign different aggregation on different hierarchy level. So these calculation can't be explored on different level.

 

Rergards,

View solution in original post

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

@GabrielM

 

In this scenario, I assume you have a Date/Time to get those certain moments. However, since there's no direct relationship between these certain moments and your source table. You can't include the fields from these two tables into same chart visual.

 

For your requirement, you can only create a slicer for those certain moments, the build a measure to get the last status for each task.

 

Last Status = 
var MaxTime = CALCULATE(MAX(Table3[Time]),FILTER(Table3,Table3[Time]<=MAX(Table4[Time])))
return
CALCULATE(MAX(Table3[Status]),FILTER(Table3,Table3[Time]=MaxTime))

Capture.PNG

 

 

And to calculate the number of tasks for each status, we have to summarize above table into calculated table. However, it's not possible to generate a dynamic table. And we can't assign different aggregation on different hierarchy level. So these calculation can't be explored on different level.

 

Rergards,

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.