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
HongQiu
Regular Visitor

Show sum of actuals when selected dates less than Max order date otherwise show forecast

I have date hierarchy filters in dashboard: Year filter, Quarter filter, Month filter. the max actual sales date is Feb 2022.  how to show the current actual + forecast if user selects Quarter 1( which including 2 months actuals and 1 month forecast ) ?
Or maybe user select different month, like Jan, Feb, April, Sep. I would like my measure results show sum of actuals from Jan and Feb + sum of forecast from April and Sep.

 

Thank you so much.

 

 

 

1 ACCEPTED SOLUTION

I have managed to do this by using this dax

meansurename = sumx(calendar, if(posting date<=dataRefreshingDate, [actuals],[forecast]))

View solution in original post

5 REPLIES 5
HongQiu
Regular Visitor

Could anyone please share how to use a similar function like selectedvalue to achieve this? selectedvalue only can return one date, what I would like to do is let user select multiple dates. I do have date table that connect the actuals and forecast, I dont want to append these two tables is because actuals and forecast show different levels data, with more than 1 year data, the file will be very big... thank you. 

I have managed to do this by using this dax

meansurename = sumx(calendar, if(posting date<=dataRefreshingDate, [actuals],[forecast]))

Ashish_Mathur
Super User
Super User

Hi,

Actual and Forecast should appear in 1 Fact table.  Create a Calendar Table and build a relationship from the Date column of the combined Fact Table and the Date column of the Calendar Table.  To your visual, drag Year, Month name from the Calendar Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

yes, I agree the best case is to have a good data model. but currently I only have actuals and forecast(higher category level) in different file. that would be great if you have some tips on dax. thanks

You can still append the 2 tables. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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