Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello, I have the following table in Power BI,
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 Workday | QTD Shipments | Daily 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!
Solved! Go to Solution.
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.
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.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.