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

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.

Reply
Zoreen
Frequent Visitor

Forecast Order Number - Ignoring the last 2 years (DAX)

Hello everyone, 

 

I am super glad to be part of this community. I am new to Power BI and I am excited about the journey so far. 

I have a report I am working on which currently tracks Orders Request and Orders Delivered. I am trying to write a DAX measure to predict future order quantinty to help my team be more proactive. I have historic data from 2017 - 2022. Due to the pandemic, the data from 2020 - 2021 might not be too useful for my analysis.

 

My question, is there a way I can write a DAX measure to have this years filtered out, or will it be useful to have this in for analysis? I would also appreciate if I can get the right formular to help me with my analysis 😊  Please see a sample table below.

 

Thank you!!! 

 

Order DateTotal RequestedDelivery date Total Delivered
5/15/2022455/19/202240
6/15/2022106/21/20228
7/15/2022507/20/202230
8/15/2022-  
9/15/2022-  
10/15/2022-  

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Zoreen ,

I created some data:

vyangliumsft_0-1659490600950.png

If you want to filter to this year's data, you can use measure to mark it and place it in Fliter for processing

Here are the steps you can follow:

1. Create measure.

Flag =
IF(
    MAX('Table'[Order Date])>=DATE(YEAR(TODAY()),1,1),1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1659490600951.png

3. Result:

vyangliumsft_2-1659490600952.png

What is the rule of total number of orders requested that you want to predict? Can you express it in the form of pictures? We can help you better

If you need pbix, please click here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @Zoreen ,

I created some data:

vyangliumsft_0-1659490600950.png

If you want to filter to this year's data, you can use measure to mark it and place it in Fliter for processing

Here are the steps you can follow:

1. Create measure.

Flag =
IF(
    MAX('Table'[Order Date])>=DATE(YEAR(TODAY()),1,1),1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1659490600951.png

3. Result:

vyangliumsft_2-1659490600952.png

What is the rule of total number of orders requested that you want to predict? Can you express it in the form of pictures? We can help you better

If you need pbix, please click here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@Zoreen , Create a date table with year, month qtr etc

Addcolumns(calendar(date(2020,01,01), date(2021,12,31) ), "Month no" , month([date])
, "Year", year([date])
, "Month Year", format([date],"mmm-yyyy")
, "Month year sort", year([date])*100 + month([date])
, "Month",FORMAT([Date],"mmmm")
, "Month sort", month([DAte])

)

 

Join this with all dates. Only one join will be active, others you can activate using userelationship in measure

 

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

 

Use slicer from date table to filter

Hi @amitchandak 

 

Thank you for your response and sharing this resource. I have a DimDate set up connected to my FactTable. I will use this formula for my Delivery date.

 

I am still struggling with the right formular to get a forecast total number of orders requested for the future. Currently I am trying to write a DAX formular that calculates the Compound Annual Increase Rate then use this value to Calculate the Forecast, but its getting a little too complicated for me. 

 

Thank you so much!

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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