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
jg13
New Member

Looking to find previous days data without dates

Hello, I have the following table in Power BI,

 

jg13_0-1726772943140.png


I am trying to create another column that simply subtracts the current Period Workday's QTD Shipments from yesterday. So for example, in Period Workday 2 I would want 3,567,993. Period Workday 0 is not needed and Period Workday 1 will always stay the same. Period Workday is also a Whole Number data type. I've looked everywhere and can't find a solution to this. If possible, I'd like to be able to do this using a measure and not have to add an index column in my backend.

This is how I want the table to look:

Period WorkdayQTD ShipmentsDaily Pounds Shipped
1            2,582,394                          2,582,394
2            6,150,387                          3,567,993
3            8,769,701                          2,619,314
4          11,336,278                          2,566,577
5          15,017,745                          3,681,467
6          15,969,864                             952,119
7          19,876,825                          3,906,961
8          23,209,836                          3,333,011
9          25,905,130                          2,695,294
10          29,757,335                          3,852,205
11          32,742,357                          2,985,022
12          35,744,453                          3,002,096
13          38,217,875                          2,473,422
14          41,071,749                          2,853,874
15          44,965,615                          3,893,866
16          47,741,766                          2,776,151
17          51,061,310                          3,319,544
18          53,881,103                          2,819,793

 

Thank you!

1 ACCEPTED SOLUTION
SamWiseOwl
Super User
Super User

Hi @jg13 

Create a measure like this:
Daily Pounds Shipped =
var DayNum = SelectedValue(table[Period Workday])

var PreviousDayNum = SelectedValue(table[Period Workday])-1

var Previous = Calculate( SUM(table[QTD Shipments]), table[Period Workday] =PreviousDayNum)

RETURN
IF(
DayNum = 1 , SUM(table[QTD Shipments]), SUM(table[QTD Shipments]) - Previous)


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

1 REPLY 1
SamWiseOwl
Super User
Super User

Hi @jg13 

Create a measure like this:
Daily Pounds Shipped =
var DayNum = SelectedValue(table[Period Workday])

var PreviousDayNum = SelectedValue(table[Period Workday])-1

var Previous = Calculate( SUM(table[QTD Shipments]), table[Period Workday] =PreviousDayNum)

RETURN
IF(
DayNum = 1 , SUM(table[QTD Shipments]), SUM(table[QTD Shipments]) - Previous)


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

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