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

Calculate percentage difference between count of two dates

My data set :

 

DateCategoryCount
01-05-2020ABC313
01-05-2020DEF1000
02-05-2020ABC33
02-05-2020DEF33
03-05-2020ABC38
03-05-2020DEF21

 

My expected outcome is to get the rate values as shown below for respective dates:

 

Category01-05-202002-05-202003-05-202001-05-2020(new)02-05-2020(new)03-05-2020(new)
ABC

313

33

38

N/A

-89%

15%

DEF

1000

166

21

N/A

-83%

-87%

 

 

How to write the following formula in DAX : (33 * 100 / 313) - 100 = -89% or ([COUNT OF TODAY'S DATE] * 100 / [COUNT OF YESTERDAY'S DATE]) - 100

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

You need to create measure in powerbi design pane instead of in power query pane. You could refer to my sample for details.

Best Regards,
Zoe Zhi

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , You can get the last date like this using date table

Last Day Non Continous = CALCULATE(sum('order'[Qty]),filter(all(Table),Table[Date] =MAXX(FILTER(all(Table),Table[Date]<max(Table[Date])),Table[Date])))
Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd(Table[Date],-1,Day))

 

This Day =SUM(Sales[Sales Amount])

 

Then take a diff % like divide(([This Day]-[Day behind Sales]),[Day behind Sales])

 

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

Sorry, I'm very new to this.

Where should I apply this? Here?

 

cccccc.png

@amitchandak 

dax
Community Support
Community Support

Hi @Anonymous , 

You need to create measure in powerbi design pane instead of in power query pane. You could refer to my sample for details.

Best Regards,
Zoe Zhi

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

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.

Top Solution Authors