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
Anonymous
Not applicable

Running total for records in table

Hi all, 

 

I am trying to create a historical trendline showing the past status of a KPI in a table but struggle to do so

 

Below is the example table used  

Table_1

Order NumberStatusDate ApprovedDate ClosedCondition ACondition B
1Open 1-Nov-17 NoNo
2Closed2-Feb-181-Jan-19NoNo
3Open 3-Mar-18 YesNo
4Open 4-Apr-19 NoNo
5Closed10-Apr-192-Feb-20NoNo

 

Using the table as an example, let's define the open record KPI for that reporting month as KPI-01

 

I am able to calculate the KPI record for the current month by creating this measure:

 

KPI-01 =

Calculate ( DistinctCountNoblank[OrderNumber], Filter(Table_1, Table_1[Condition A]= "No" && Table_1[Condition B]= "No], Table_1[Status] = "Open"]

 

Note : Condition A, B need to be "No" and Status need to be Open in order to qualify as a Count in KPI-01

 

However, I want to create a historical line chart where it shows the no. of KPI-01 based on the slicer date and not affected by the record status e.g.

  • If i sliced the date to May 18, it should show the historical KPI-01 value of 2 records 
  • If i sliced the date to Jan 20, it should show KPI-01 value as 3 records.
  • If i sliced the date till today, it should show KPI-01 value as 2 records

I have written the following running total dax only to realise that it is affected by the record status.

 

Total KPI-01 =
CALCULATE([KPI-01] ,
FILTER(
All(Table_1), Table_1[Date Approved ] <= MAX(Table_1[Date Approve])))

 

How can the running total DAX be written to reflect the historical record trend without being affected by the record status ?

 

Appreciate your help in this issue. Thanks !

 

3 REPLIES 3
wdx223_Daniel
Super User
Super User

@Anonymous  be careful of the function of DATEVALUE, it may not convert the text to datevalue you want.

wdx223_Daniel_0-1604368766981.png

 

amitchandak
Super User
Super User

@Anonymous , Check if my blog on HR with Strat and end date can help on this topic too

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

Video: https://www.youtube.com/watch?v=e6Y-l_JtCq4

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak 

 

Thanks. Let me take a look to see if it can be adapted. 

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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