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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Ken_Jorp
Frequent Visitor

Count days and avg days in state per period

Hi,

I have a table containing many years of transaction history with 100's of serial numbers. The serial numbers have been in several different statuses.

I want to count days per period (per week, month, year) where:

1. The specific serial numbers have been in Redress Status, based by dates between: Startdate: Status "Redress In" to End Date: Status "Redress Out".

2. The specific serial numbers are in Redress Status now ("Redress In" Date to today), based on where the last status on serial number is "Redress In"

 

I already have the "Count days" result based on my own columns/measures, but my problem is that I can't figure out how to count these days per e.g Month. If you look at row 2 in my example, I need the result to display 17 days in Sept and 4 days in Aug. As it is now, I will get 21 days in September, which is not correct when I want to calculate avg days pr month- or other periods.

Please note that there can be several transactions in one day, so the dates need to be based on index. 

 

Serial No   Status              Index               DT           Days on Redress

311381Redress In853545027.08.2020 00:00 
311381Redress Out864489117.09.2020 00:0021
296855Redress In904516330.11.2020 00:00 
296855Redress Out910606910.12.2020 00:0010
296855Redress In936670729.01.2021 00:0034
311381Redress In943194009.02.2021 00:0023
0 REPLIES 0

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.