Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi
I have a data table with forecast data and one with actuals.
Sometimes they overlap (for example when i recive the actuals for October but we have not forecasted from November yet - I have both actuals and forecast for October...)
In that case I just want to exclude data for October from the forecast table - "the actual data overrides the forecast"
I have tried this approch
Meassure calculates the last month of actuals
Last actual date = lastdate(Actuals[Date])
Messure calculates forecast if date is lower than year end and bigger than "last actual date"
Forecast remaining of year = calculate(sum(Forecast[Sum of Quantity Ton]);and(forecast[date]>=[Last actual date];forecast[date]<=date(year(today());12;31)))
But I get this "A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
I dont get it?
Please can you give me a hand? Or is there a smarter way of doing this? 🙂
Thanks
Martin
Solved! Go to Solution.
Hi @Anonymous
It complains because you are using the simplified syntax for the filter with something that is not allowed. To solve that issue ( and that issue only, I haven't looked at the rest), try:
Forecast remaining of year = CALCULATE ( SUM ( Forecast[Sum of Quantity Ton] ); FILTER ( ALL ( forecast[date] ); AND ( forecast[date] >= [Last actual date]; forecast[date] <= DATE ( YEAR ( TODAY () ); 12; 31 ) ) ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi @Anonymous
It complains because you are using the simplified syntax for the filter with something that is not allowed. To solve that issue ( and that issue only, I haven't looked at the rest), try:
Forecast remaining of year = CALCULATE ( SUM ( Forecast[Sum of Quantity Ton] ); FILTER ( ALL ( forecast[date] ); AND ( forecast[date] >= [Last actual date]; forecast[date] <= DATE ( YEAR ( TODAY () ); 12; 31 ) ) ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
@AlB wrote:Hi @Anonymous
It complains because you are using the simplified syntax for the filter with something that is not allowed. To solve that issue ( and that issue only, I haven't looked at the rest), try:
Forecast remaining of year = CALCULATE ( SUM ( Forecast[Sum of Quantity Ton] ); FILTER ( ALL ( forecast[date] ); AND ( forecast[date] >= [Last actual date]; forecast[date] <= DATE ( YEAR ( TODAY () ); 12; 31 ) ) ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Worked like a charm!
Great suport
Thanks alot AIB!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |