Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Noor_Ahmad
New Member

Need Help Regarding Last 2 Months Order Calculation

Hello Everyone,

 

I have a dataset containing the product orders of three years (2021, 2022, 2023). For each Year, I have data for 6 months (Starting from March to August). I have calculated the "Total Orders InFull" for the dataset by the following manner:

 

Total Orders InFull =
CALCULATE( [Total Orders], Fact_Order_Aggregate[in_full] = 1)

 

Now I've created a table visual. In the 1st column, I put the "Start of Month" for the selected year. In the 2nd column, I put the "Total Orders InFull" for each month. In the 3rd column, I want to put the "Total InFull Orders Compared with Last 2 Months". I used DATEADD function to calculate the measure like below:

 

Total InFull Orders Compared with Last 2 Months =
CALCULATE( [Total Orders InFull], DATEADD(Dim_Date[Date], -2, MONTH))
 
Now, my table is looking like this (I added two pictures, one for Year-2022 Selection, another for Year-2023 Selection):
 
Screenshot_1.pngScreenshot_2.png

 

 

But I wanted the Table in such a way, for any given "Start of Month", the "Total InFull Orders Compared with Last 2 Months" should not be empty & should contain the "Total InFull Orders" of two months before.

 

For Example, In the 2nd screenshots (Year-2023 filter), the "Total InFull Orders Compared with Last 2 Months" of Saturday, April 01, 2023 should not be empty, and should be the "Total Orders InFull" of Friday, July 01, 2022, i.e. 939.

 

Please suggest me how can I fill those empty values with the proper values I want by keeping the Year Slicer.

 

@lbendlin 

 

 

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

2 REPLIES 2
lbendlin
Super User
Super User

lbendlin_0-1711569941109.png

 

Thank you so much, sir. This solution worked as I wanted

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.