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
Syndicate_Admin
Administrator
Administrator

Subtract and get less previous current date quantity

Hello powerbi community, cordial greeting.

Again I am here to ask for support, I am needing to create a new calculated column that brings me the difference that exists between the minor date and the next date of people.

For example: If on 26/03/2020 I have 5 people, then the difference against the previous date which is 19/03/2020 is 2. Because the 5 - 3 = 2 is subtracted.

Attached example image, result to get column Dif_por_dia.

WolterNet_0-1645674204780.png

In advance thank you very much always for your support.

Cordially

Wolter

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I tried to create similar sample data like below.

Please check the below picture and the attached pbix file.

 

Picture2.png

 

Dif_por_dia CC =
VAR currentdatevalue = Data[Cantidad_Personas]
VAR currentdate = Data[Date]
VAR previousdate =
MAXX ( FILTER ( Data, Data[Date] < currentdate ), Data[Date] )
VAR previousdatevalue =
MAXX ( FILTER ( Data, Data[Date] = previousdate ), Data[Cantidad_Personas] )
RETURN
currentdatevalue - previousdatevalue

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Thank you very much, it worked perfectly.

Jihwan_Kim
Super User
Super User

Hi,

I tried to create similar sample data like below.

Please check the below picture and the attached pbix file.

 

Picture2.png

 

Dif_por_dia CC =
VAR currentdatevalue = Data[Cantidad_Personas]
VAR currentdate = Data[Date]
VAR previousdate =
MAXX ( FILTER ( Data, Data[Date] < currentdate ), Data[Date] )
VAR previousdatevalue =
MAXX ( FILTER ( Data, Data[Date] = previousdate ), Data[Cantidad_Personas] )
RETURN
currentdatevalue - previousdatevalue

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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
Top Kudoed Authors