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

Normalize time series data to first non-zero

I have a time-series table that has daily date resolution. The table has unique properties that have individual arrays with varying first production dates. What I want to be able to do is a build a visualization that aggregates common properties but summarizes the production arrays to Day 0 equaliing the First Non-Zero value.

 

For example, if Property A has its first non-zero value on 2/15 and equals 10 units while Property B has its first non-zero value on 3/1 and equals 20 units

 

Then I want the visualization to aggregate Day 0 to Day 365 and Day 0 would equal 30 units in this case. 

 

Thanks for the help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous,

Please create the following measure and check column in your original table.

Measure = MAXX(Table1,CALCULATE(MIN(Table[Date]),FILTER(ALL(Table), Table[ID]= EARLIER(Table[ID])&&Table[Production]>0)))
Check = IF([Measure]<=Table[Date],1,0)


Then create new table using DAX below.

NewTable = CALCULATETABLE(Table,Table[Check]>0)


And change DAX of Index column to the following:

Index = RANKX(FILTER(NewTable,NewTable[ID]=EARLIER(NewTable[ID])),[Date],,ASC,Dense)



Regards,
Lydia

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@Anonymous,

I make a test in my sample table.

1.PNG

Firstly, create a new table using DAX below.

NewTable = CALCULATETABLE(TEST,TEST[unit]>0)


Secondly, create the following columns in the new table.

Index = RANKX(FILTER(NewTable,NewTable[property]=EARLIER(NewTable[property])),[Date],,ASC,Dense)
Day = "Day" &(NewTable[Index]-1)


At last, create chart as below. If the above DAX don't help, please share sample data of your table for us to analyze.
2.PNG


Regards,
Lydia

Anonymous
Not applicable

I have a follow up question. It is not unusual that some of the data arrays will have zero values following the first non-zero value. I'd like to include these in the evaluation, so in this case, we are only filtering out all zeros before the first non-zero. 

 

How could I modify the calculatetable formula in that regard?

Anonymous
Not applicable

@Anonymous,

Could you please share sample data of your table here?


Regards,
Lydia

Anonymous
Not applicable

@Anonymous

 

IDDateProduction
A1/1/20190
A1/2/20190
A1/3/20190
A1/4/20190
A1/5/20190
A1/6/20190
A1/7/20190
A1/8/20190
A1/9/201910
A1/10/201920
A1/11/201930
A1/12/201940
A1/13/201950
A1/14/201950
A1/15/201950
A1/16/20190
A1/17/20190
A1/18/20190
A1/19/20190
A1/20/20190
A1/21/20190
A1/22/201910
A1/23/201920
A1/24/201930
A1/25/201940
A1/26/201950
A1/27/201950
A1/28/201950
A1/29/201950
A1/30/201950
A1/31/201950
Anonymous
Not applicable

@Anonymous,

Please create the following measure and check column in your original table.

Measure = MAXX(Table1,CALCULATE(MIN(Table[Date]),FILTER(ALL(Table), Table[ID]= EARLIER(Table[ID])&&Table[Production]>0)))
Check = IF([Measure]<=Table[Date],1,0)


Then create new table using DAX below.

NewTable = CALCULATETABLE(Table,Table[Check]>0)


And change DAX of Index column to the following:

Index = RANKX(FILTER(NewTable,NewTable[ID]=EARLIER(NewTable[ID])),[Date],,ASC,Dense)



Regards,
Lydia

Anonymous
Not applicable

Thank you. That was perfect. Appreciate the help

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors