Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi all,
I am creating a forecast with two measurements.
Measurement X is a forecast for the year that is developed at the beginning of the year
Measurement Y is real data that is collected throughout the year
My combined Forecast takes the Real Data and combines it with the beginning of the year forecast.
For example, if I have data through the month of May, I use Measurement Y (the real data) for the first five months of the year and then use Measurement X (the forecast) for the remaining months of the yea.
I did this by writing a switch statement where if the Value for the real data was 0, then it returns the forecast.
It works well except for when I am grouping by quarters of the year or the full year. I think this is because when the switch statement is performed at the quarterly level, it will not take the forecast of a month that has not happened.
For an example, I have the following screenshots:
See that in Q2, while the months of April May and June all have data for the grey bar (Measurement Y), only the first two months are summed in the quarterly view.
Any help is greatly appreciated. Thank you.
Solved! Go to Solution.
Hi @Anonymous ,
//See that in Q2, while the months of April May and June all have data for the grey bar (Measurement Y), only the first two months are summed in the quarterly view.
//Measurement Y is real data that is collected throughout the year.
This should be well understood since there is no data for June, the Measurement Y for Q2 will only aggregate data for April and May.
What is your expected output? Is the Measurement Y for the second quarter the sum of the April and May actual data and the June forecast data? If so, create this measure.
MeasureY =
VAR _table =
SUMMARIZE (
'Calendar',
'Calendar'[Year],
'Calendar'[Quarter],
'Calendar'[Month],
"Actual",
VAR _value1 =
SUM ( 'Table'[Value] )
VAR _value2 = [MeasureX]
VAR _result =
IF ( _value1 = 0, _value2, _value1 )
RETURN
_result,
"Forecast", [MeasureX]
)
VAR _value = SUMX(_table,[Actual])
RETURN
_value
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @Anonymous ,
Has this problem been solved? If you have solved it, you can post your solution here. If any of the responses were helpful to you, please consider marking them as solutions, which will help more users find similar problems faster. If the problem is not solved, please feel free to let us know. Thanks in advance!
Best Regards,
Gao
Community Support Team
Hi @Anonymous ,
//See that in Q2, while the months of April May and June all have data for the grey bar (Measurement Y), only the first two months are summed in the quarterly view.
//Measurement Y is real data that is collected throughout the year.
This should be well understood since there is no data for June, the Measurement Y for Q2 will only aggregate data for April and May.
What is your expected output? Is the Measurement Y for the second quarter the sum of the April and May actual data and the June forecast data? If so, create this measure.
MeasureY =
VAR _table =
SUMMARIZE (
'Calendar',
'Calendar'[Year],
'Calendar'[Quarter],
'Calendar'[Month],
"Actual",
VAR _value1 =
SUM ( 'Table'[Value] )
VAR _value2 = [MeasureX]
VAR _result =
IF ( _value1 = 0, _value2, _value1 )
RETURN
_result,
"Forecast", [MeasureX]
)
VAR _value = SUMX(_table,[Actual])
RETURN
_value
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
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 |
---|---|
84 | |
72 | |
68 | |
41 | |
35 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
42 |