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! Learn more

Reply
Anonymous
Not applicable

Which day recorded the maximum volume growth compared to previous day

Hi All,

 

Need you help for one of my task.

I want to know Which day recorded the maximum volume growth compared to previous day.

I have added previous day column using 

 
DateTotal SalesPreviousDaySales
2/1/2020235 
2/2/2020142235
2/3/2020150142
2/4/2020167150
2/5/2020141167
2/6/2020197141
2/7/2020244197
2/8/2020254244
2/9/2020281254
2/10/2020245281
2/11/2020195245
2/12/2020202195
2/13/2020210202
2/14/2020118210
2/15/202071118
2/16/202020071
2/17/2020148200
2/18/2020162148
2/19/2020242162
2/20/2020279242
2/21/2020299279
2/22/2020197299
2/23/2020187197
2/24/2020155187
2/25/2020158155
2/26/2020142158
2/27/2020252142
2/28/2020247252
2/29/2020270247
3/1/2020290270
3/2/2020286290
3/3/2020132286
3/4/2020242132
3/5/2020123242
3/6/2020128123
3/7/202088128
3/8/202032388
3/9/2020255323
3/10/2020228255
3/11/2020209228
3/12/2020195209
But not sure what will be the next step.

 

@smpa01 @PowerB @Anonymous 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Please refer to sample file with the proposed solution. I assumed that the presented data is aggregated at day level, therefore the measure is built from scratch

1.png

Max Date Growth = 
VAR T1 = 
    ADDCOLUMNS ( 
        VALUES ( Data[Date] ),
        "@Total",
        CALCULATE ( SUM ( Data[Total ] ) ),
        "@Previous",
        VAR CurrentDate = Data[Date]
        VAR CurrentValue = CALCULATE ( SUM ( Data[Total ] ) )
        RETURN 
            CALCULATE ( SUM ( Data[Total ] ), Data[Date] = CurrentDate - 1 )
    )
VAR T2 = FILTER ( T1, [@Previous] <> BLANK ( ) )
VAR T3 = ADDCOLUMNS ( T2, "@Growth", [@Total] - [@Previous] )
VAR T4 = TOPN ( 1, T3, [@Growth] )
RETURN
    MAXX ( T4, [Date] )

View solution in original post

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Measure:

PreviousDaySales = 
Var PrevDate=MAXX(FILTER(ALL('Table'[Date]),'Table'[Date]<SELECTEDVALUE('Table'[Date])),[Date])
Var PreviousDaySales=CALCULATE(SUM('Table'[Total Sales]),FILTER(ALL('Table'),[Date]=PrevDate))
Return
PreviousDaySales
Growth = SUM('Table'[Total Sales])-[PreviousDaySales]
MaxGrowthDate = 
Var MaxGrowth=MAXX('Table',[Growth])
Return
MAXX(FILTER(ALL('Table'),[Growth]=MaxGrowth),[Date])

vzhangti_0-1662453110410.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you for your reply. it workes for me!!!

 

tamerj1
Super User
Super User

Hi @Anonymous 
Please refer to sample file with the proposed solution. I assumed that the presented data is aggregated at day level, therefore the measure is built from scratch

1.png

Max Date Growth = 
VAR T1 = 
    ADDCOLUMNS ( 
        VALUES ( Data[Date] ),
        "@Total",
        CALCULATE ( SUM ( Data[Total ] ) ),
        "@Previous",
        VAR CurrentDate = Data[Date]
        VAR CurrentValue = CALCULATE ( SUM ( Data[Total ] ) )
        RETURN 
            CALCULATE ( SUM ( Data[Total ] ), Data[Date] = CurrentDate - 1 )
    )
VAR T2 = FILTER ( T1, [@Previous] <> BLANK ( ) )
VAR T3 = ADDCOLUMNS ( T2, "@Growth", [@Total] - [@Previous] )
VAR T4 = TOPN ( 1, T3, [@Growth] )
RETURN
    MAXX ( T4, [Date] )
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

Here's a measure that uses the TOPN function to find the largest volume growth

Date with Max Volume Growth = 
MAXX(
	TOPN(1, 
		FILTER('Table', NOT ISBLANK('Table'[PreviousDaySales])), 
		'Table'[Total Sales] - 'Table'[PreviousDaySales], DESC
		),
	'Table'[Date]
	)

The FILTER makes sure it doesn't return the first date in the data (that has no previous day sales).  The MAXX will get the latest date in the event there's more than 1 date with the largest volume growth.  You could use MINX if you wanted the earliest instead.

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.