Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have 2 tables-
Order status
Day differnce tell day between ETA abd Actual Delivery date. Difference column shows 1 whwere it was on time and 0 when delayed.
Created From | Date | ETA | Actual Delivery Date | Day Difference | Difference | Budget Category | |
SO00310359 | Thursday, 3 March 2022 | 7/03/2022 | Monday, 7 March 2022 | 0 | 1 | Retail | |
SO00311030 | Thursday, 3 March 2022 | 7/03/2022 | Friday, 4 March 2022 | 3 | 1 | Promotional | |
SO00310646 | Tuesday, 1 March 2022 | 24/02/2022 | Wednesday, 23 February 2022 | 1 | 1 | Hospitality | |
SO00310853 | Tuesday, 1 March 2022 | 3/03/2022 | Wednesday, 2 March 2022 | 1 | 1 | Promotional | |
SO00310929 | Tuesday, 1 March 2022 | 3/03/2022 | Thursday, 3 March 2022 | 0 | 1 | Hospitality | |
SO00310960 | Tuesday, 1 March 2022 | 4/03/2022 | Thursday, 3 March 2022 | 1 | 1 | Promotional | |
SO00310479 | Tuesday, 1 March 2022 | 4/03/2022 | Thursday, 3 March 2022 | 1 | 1 | Promotional | |
SO00310849 | Tuesday, 1 March 2022 | 4/03/2022 | Thursday, 3 March 2022 | 1 | 1 | Promotional | |
SO00310885 | Monday, 28 February 2022 | 2/03/2022 | Wednesday, 2 March 2022 | 0 | 1 | Hospitality | |
SO00310629 | Friday, 18 February 2022 | 22/02/2022 | Tuesday, 22 February 2022 | 0 | 1 | Promotional | |
SO00310501 | Wednesday, 16 February 2022 | 18/02/2022 | Thursday, 17 February 2022 | 1 | 1 | Promotional | |
SO00310131 | Wednesday, 16 February 2022 | 22/02/2022 | Friday, 18 February 2022 | 4 | 1 | Hospitality | |
SO00310422 | Wednesday, 16 February 2022 | 18/02/2022 | Thursday, 17 February 2022 | 1 | 1 | Hospitality | |
SO00310538 | Wednesday, 16 February 2022 | 18/02/2022 | Thursday, 17 February 2022 | 1 | 1 | Promotional | |
SO00310488 | Wednesday, 16 February 2022 | 18/02/2022 | Thursday, 17 February 2022 | 1 | 1 | Hospitality | |
SO00310516 | Wednesday, 16 February 2022 | 18/02/2022 | Wednesday, 2 March 2022 | -12 | 0 | Promotional | |
SO00310267 | Wednesday, 9 February 2022 | 11/02/2022 | 1 | Promotional | |||
SO00310050 | Tuesday, 8 February 2022 | 16/02/2022 | Wednesday, 16 February 2022 | 0 | 1 | Hospitality | |
SO00309741 | Tuesday, 8 February 2022 | 10/02/2022 | 1 | Promotional | |||
SO00310263 | Tuesday, 8 February 2022 | 10/02/2022 | 1 | Promotional | |||
SO00310124 | Thursday, 3 February 2022 | 7/02/2022 | 1 | Promotional | |||
SO00310133 | Thursday, 3 February 2022 | 7/02/2022 | 1 | Hospitality | |||
SO00309243 | Friday, 14 January 2022 | 18/01/2022 | Monday, 17 January 2022 | 1 | 1 | Hospitality | |
SO00308728 | Friday, 14 January 2022 | 20/01/2022 | Tuesday, 18 January 2022 | 2 | 1 | Hospitality | |
SO00308565 | Friday, 14 January 2022 | 31/01/2022 | Monday, 24 January 2022 | 7 | 1 | Hospitality | |
SO00308478 | Friday, 14 January 2022 | 31/01/2022 | Friday, 21 January 2022 | 10 | 1 | Hospitality | |
SO00308830 | Wednesday, 12 January 2022 | 17/01/2022 | Friday, 14 January 2022 | 3 | 1 | Promotional | |
SO00309127 | Wednesday, 12 January 2022 | 14/01/2022 | Friday, 14 January 2022 | 0 | 1 | Promotional | |
SO00309120 | Wednesday, 12 January 2022 | 14/01/2022 | Friday, 14 January 2022 | 0 | 1 | Promotional | |
SO00309094 | Wednesday, 12 January 2022 | 17/01/2022 | Thursday, 13 January 2022 | 4 | 1 | Promotional | |
SO00309481 | Wednesday, 12 January 2022 | 17/01/2022 | Thursday, 13 January 2022 | 4 | 1 | Hospitality | |
SO00309261 | Tuesday, 11 January 2022 | 13/01/2022 | Friday, 14 January 2022 | -1 | 0 | Hospitality | |
SO00309129 | Tuesday, 11 January 2022 | 14/01/2022 | Wednesday, 19 January 2022 | -5 | 0 | Hospitality | |
SO00309001 | Wednesday, 5 January 2022 | 7/01/2022 | Monday, 10 January 2022 | -3 | 0 | Hospitality | |
SO00309041 | Thursday, 30 December 2021 | 4/01/2022 | Wednesday, 5 January 2022 | -1 | 0 | Hospitality | |
SO00309017 | Thursday, 30 December 2021 | 5/01/2022 | Tuesday, 4 January 2022 | 1 | 1 | Hospitality | |
SO00309104 | Wednesday, 29 December 2021 | 31/12/2021 | Thursday, 30 December 2021 | 1 | 1 | Hospitality | |
SO00308511 | Wednesday, 29 December 2021 | 4/01/2022 | Friday, 31 December 2021 | 4 | 1 | Hospitality | |
SO00308512 | Wednesday, 29 December 2021 | 4/01/2022 | Friday, 31 December 2021 | 4 | 1 | Hospitality | |
SO00308825 | Thursday, 23 December 2021 | 29/12/2021 | Friday, 24 December 2021 | 5 | 1 | Hospitality | |
SO00308867 | Wednesday, 22 December 2021 | 24/12/2021 | Thursday, 23 December 2021 | 1 | 1 | Hospitality | |
SO00308517 | Wednesday, 22 December 2021 | 11/01/2022 | Wednesday, 5 January 2022 | 6 | 1 | Hospitality | |
SO00308842 | Wednesday, 22 December 2021 | 24/12/2021 | Thursday, 23 December 2021 | 1 | 1 | Hospitality | |
SO00307116 | Tuesday, 21 December 2021 | 23/12/2021 | Thursday, 23 December 2021 | 0 | 1 | Hospitality | |
SO00309000 | Tuesday, 21 December 2021 | 24/12/2021 | Friday, 24 December 2021 | 0 | 1 | Promotional | |
SO00308783 | Tuesday, 21 December 2021 | 23/12/2021 | Wednesday, 22 December 2021 | 1 | 1 | Hospitality | |
SO00307973 | Tuesday, 21 December 2021 | 30/12/2021 | Thursday, 30 December 2021 | 0 | 1 | Hospitality | |
SO00309044 | Tuesday, 21 December 2021 | 4/01/2022 | Tuesday, 4 January 2022 | 0 | 1 | Hospitality | |
SO00308504 | Tuesday, 21 December 2021 | 23/12/2021 | Wednesday, 22 December 2021 | 1 | 1 | Promotional | |
SO00308824 | Monday, 20 December 2021 | 22/12/2021 | Tuesday, 21 December 2021 | 1 | 1 | Hospitality | |
SO00308465 | Monday, 20 December 2021 | 22/12/2021 | Wednesday, 29 December 2021 | -7 | 0 | Promotional | |
SO00308823 | Monday, 20 December 2021 | 23/12/2021 | Wednesday, 22 December 2021 | 1 | 1 | Hospitality | |
SO00308863 | Monday, 20 December 2021 | 22/12/2021 | Tuesday, 21 December 2021 | 1 | 1 | Hospitality | |
SO00308697 | Monday, 20 December 2021 | 22/12/2021 | Tuesday, 21 December 2021 | 1 | 1 | Hospitality | |
SO00308991 | Monday, 20 December 2021 | 22/12/2021 | Tuesday, 21 December 2021 | 1 | 1 | Promotional | |
SO00308787 | Monday, 20 December 2021 | 22/12/2021 | Tuesday, 21 December 2021 | 1 | 1 | Hospitality | |
SO00308992 | Monday, 20 December 2021 | 23/12/2021 | Thursday, 23 December 2021 | 0 | 1 | Hospitality | |
SO00307774 | Monday, 20 December 2021 | 22/12/2021 | Tuesday, 21 December 2021 | 1 | 1 | Hospitality | |
SO00308924 | Monday, 20 December 2021 | 22/12/2021 | Wednesday, 22 December 2021 | 0 | 1 | Promotional | |
SO00308732 | Monday, 20 December 2021 | 22/12/2021 | Wednesday, 22 December 2021 | 0 | 1 | Hospitality | |
SO00308736 | Monday, 20 December 2021 | 22/12/2021 | Wednesday, 22 December 2021 | 0 | 1 | Hospitality | |
SO00308444 | Friday, 17 December 2021 | 21/12/2021 | Monday, 20 December 2021 | 1 | 1 | Promotional | |
SO00308740 | Friday, 17 December 2021 | 21/12/2021 | Monday, 20 December 2021 | 1 | 1 | Retail | |
SO00308674 | Friday, 17 December 2021 | 22/12/2021 | Tuesday, 21 December 2021 | 1 | 1 | Hospitality | |
SO00308389 | Friday, 17 December 2021 | 30/12/2021 | Friday, 24 December 2021 | 6 | 1 | Promotional | |
SO00308510 | Friday, 17 December 2021 | 30/12/2021 | Wednesday, 22 December 2021 | 8 | 1 | Hospitality | |
SO00308913 | Friday, 17 December 2021 | 22/12/2021 | Tuesday, 11 January 2022 | -20 | 0 | Promotional | |
SO00308888 | Friday, 17 December 2021 | 21/12/2021 | Tuesday, 21 December 2021 | 0 | 1 | Hospitality | |
SO00308549 | Friday, 10 December 2021 | 14/12/2021 | Monday, 13 December 2021 | 1 | 1 | Promotional | |
SO00308464 | Friday, 10 December 2021 | 14/12/2021 | Tuesday, 14 December 2021 | 0 | 1 | Promotional | |
SO00308466 | Friday, 10 December 2021 | 17/12/2021 | Friday, 17 December 2021 | 0 | 1 | Promotional | |
SO00308367 | Thursday, 9 December 2021 | 20/12/2021 | Wednesday, 15 December 2021 | 5 | 1 | Hospitality | |
SO00308439 | Thursday, 9 December 2021 | 14/12/2021 | Tuesday, 21 December 2021 | -7 | 0 | Hospitality | |
SO00308467 | Thursday, 9 December 2021 | 15/12/2021 | Tuesday, 14 December 2021 | 1 | 1 | Hospitality | |
SO00308373 | Thursday, 9 December 2021 | 13/12/2021 | Friday, 10 December 2021 | 3 | 1 | Promotional | |
SO00308420 | Thursday, 9 December 2021 | 17/12/2021 | Wednesday, 15 December 2021 | 2 | 1 | Promotional | |
SO00307158 | Thursday, 9 December 2021 | 16/12/2021 | Wednesday, 15 December 2021 | 1 | 1 | Hospitality | |
SO00308384 | Thursday, 9 December 2021 | 14/12/2021 | Wednesday, 15 December 2021 | -1 | 0 | Hospitality | |
SO00308379 | Thursday, 9 December 2021 | 14/12/2021 | Monday, 13 December 2021 | 1 | 1 | Hospitality | |
SO00308397 | Thursday, 9 December 2021 | 21/12/2021 | Monday, 20 December 2021 | 1 | 1 | Hospitality | |
SO00308368 | Thursday, 9 December 2021 | 20/12/2021 | Wednesday, 15 December 2021 | 5 | 1 | Hospitality | |
SO00308413 | Thursday, 9 December 2021 | 13/12/2021 | Friday, 10 December 2021 | 3 | 1 | Hospitality | |
SO00308296 | Wednesday, 8 December 2021 | 14/12/2021 | Monday, 13 December 2021 | 1 | 1 | Hospitality | |
SO00308323 | Wednesday, 8 December 2021 | 13/12/2021 | Monday, 13 December 2021 | 0 | 1 | Retail | |
SO00308058 | Wednesday, 8 December 2021 | 10/12/2021 | Friday, 10 December 2021 | 0 | 1 | Promotional | |
SO00308161 | Wednesday, 8 December 2021 | 10/12/2021 | Thursday, 9 December 2021 | 1 | 1 | Promotional | |
SO00308298 | Wednesday, 8 December 2021 | 10/12/2021 | Thursday, 9 December 2021 | 1 | 1 | Promotional | |
SO00308234 | Wednesday, 8 December 2021 | 14/12/2021 | Monday, 13 December 2021 | 1 | 1 | Promotional | |
SO00308329 | Wednesday, 8 December 2021 | 10/12/2021 | Saturday, 11 December 2021 | -1 | 0 | Hospitality | |
SO00307911 | Wednesday, 8 December 2021 | 10/12/2021 | Thursday, 9 December 2021 | 1 | 1 | Hospitality | |
SO00308322 | Wednesday, 8 December 2021 | 13/12/2021 | Monday, 13 December 2021 | 0 | 1 | Retail | |
SO00308326 | Wednesday, 8 December 2021 | 13/12/2021 | Friday, 10 December 2021 | 3 | 1 | Hospitality | |
SO00307636 | Wednesday, 8 December 2021 | 21/12/2021 | Wednesday, 29 December 2021 | -8 | 0 | Hospitality | |
SO00308110 | Tuesday, 7 December 2021 | 9/12/2021 | Wednesday, 8 December 2021 | 1 | 1 | Promotional | |
SO00308370 | Tuesday, 7 December 2021 | 9/12/2021 | Wednesday, 8 December 2021 | 1 | 1 | Promotional | |
SO00307191 | Tuesday, 7 December 2021 | 9/12/2021 | Monday, 13 December 2021 | -4 | 0 | Hospitality | |
SO00307960 | Tuesday, 7 December 2021 | 10/12/2021 | Friday, 10 December 2021 | 0 | 1 | Promotional | |
SO00308231 | Tuesday, 7 December 2021 | 9/12/2021 | Wednesday, 8 December 2021 | 1 | 1 | Promotional |
second table is calender-
I need something like below-
Budget category | total of difference Column where there is 1 Current month | total of difference Column where there is 1 Past 3 months | total of difference Column where there is 1 Past 6 months |
Solved! Go to Solution.
@learner03 You can change the PeriodStart variable:
VAR _PeriodStart = EOMONTH(_MaxDate, -1)
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@learner03 You can just add +1 to make it the 1 March, but keep in mind the _PeriodStart variable is giving the end of the month to start the DATESINPERIOD() function, and then count backwards the number of months you put in the _Length variable, so not sure why you'd want it to be 1 March? 28 Feb seems like the correct start date to give past 1 month not counting this month??
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@learner03 You should be able to do this with DATESINPERIOD:
https://dax.guide/datesinperiod/
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@AllisonKennedy This works. Thanks. What if I want to exclude Current month from ast 3 or past 6.?
@learner03 You can change the PeriodStart variable:
VAR _PeriodStart = EOMONTH(_MaxDate, -1)
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@AllisonKennedy I tried at my data and somewhere struggling. When I see _period start, it is giving 28 Feb instead of 1st march.
Attached is the data file. Can you please help https://drive.google.com/file/d/1jj-af_hwm78-1JeNDutZw5mUiFpKYVD1/view?usp=sharing
@learner03 You can just add +1 to make it the 1 March, but keep in mind the _PeriodStart variable is giving the end of the month to start the DATESINPERIOD() function, and then count backwards the number of months you put in the _Length variable, so not sure why you'd want it to be 1 March? 28 Feb seems like the correct start date to give past 1 month not counting this month??
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |