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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jjsander
Regular Visitor

Running total with latest transaction information

Hello,

I have been struggling with this DAX formula for months now and the application is now occurring in several different areas of our business. I have date stamped transactional data such as the below. You can see there are duplicate Job numbers to reflect every time the status was changed. 

 

I would like to do a running count of jobs over time. My challenge is coming up with a formula that can perform the running calculation* and also filter out the older job number rows in the process**. I can do each separately but am struggling to marry the two together. 

 

Any help would be appreciated. 

 

Thanks in advance,

 

Jon

 

*running_total = CALCULATE( COUNT( [job number] ), FILTER( ALLSELECTED( 'Dates'[Date] ), 'Dates'[Date] <= MAX( 'Dates'[Date]) )))

 

**most_recent_jobs = FILTER( jobstatus, jobstatus[Change Date] = CALCULATE( MAX( jobstatus[Change Date]), ALLEXCEPT( jobstatus, jobstatus[Job Number])))

 

Job NumberStatusChange Date
10051SCH3/27/2013 0:00
10051WPLN3/27/2013 0:00
10052EAPPR3/27/2013 0:00
10052INPRG3/27/2013 0:00
10052WENG3/27/2013 0:00
10051COMP3/28/2013 0:00
10051CLOSE4/10/2013 0:00
10052WI9/16/2014 0:00
10052CLOSE11/30/2015 0:00
100508WPLN3/11/2017 0:00
100508WSCHED3/11/2017 0:00
100508SCH3/14/2017 0:00
100508NO WORK4/25/2017 0:00
100508CLOSE5/15/2017 0:00
1 REPLY 1
wdx223_Daniel
Super User
Super User

IF(max(jobstatus[Change Date])=CALCULATE( MAX( jobstatus[Change Date]), ALLEXCEPT( jobstatus, jobstatus[Job Number])),CALCULATE( COUNT( [job number] ), FILTER( ALLSELECTED( 'Dates'[Date] ), 'Dates'[Date] <= MAX( 'Dates'[Date]) )))))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.