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.
I have a table I'm showing which has several lines, all of which are measures including Actual Sales YTD and Forecast Sales Full Year.
The data is loaded right after the end of the previous quarter (Q1 data is loaded on April 1st)
The calculation for Actual Sales YTD is quite simple (Sum of all sales for this year until previous quarter).
The calculation for Forecast is Actuals up to previous quarter than Forecast for the end of the year.
Here is a simplified version of that data
Index | Type | Effective Quarter | Amount | LoadDate |
1 | Actuals | Q1 | 75 | Apr-1-2022 |
2 | Forecast | Q2 | 60 | Apr-1-2022 |
3 | Forecast | Q3 | 65 | Apr-1-2022 |
4 | Forecast | Q4 | 70 | Apr-1-2022 |
5 | Actuals | Q2 | 63 | Jul-1-2022 |
6 | Forecast | Q3 | 68 | Jul-1-2022 |
7 | Forecast | Q4 | 72 | Jul-1-2022 |
So at the end of Q1
Actual Sales YTD: 75
Forecast Full Year: (75+60+65+70) 270
And at the end of Q2
Actual Sales: 138 (75+63)
Forecast Full Year: 278
Since we have several forecasts during the year I can't just add up the rows called forecast so I have a Latest_Forecast variable which helps me dtermine to only add the right forecast
Solved! Go to Solution.
Figured it out! changed the latest_forecast variable to match the load date quarter -1 selected value on the slicer and added the extra filter within the CALCULATE
Figured it out! changed the latest_forecast variable to match the load date quarter -1 selected value on the slicer and added the extra filter within the CALCULATE
@Anonymous , With help from a date table, try measure like
Actual +forecast =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = eomonth(_max,-1*MONTH(_max))+1
var _YED = eomonth(_max,12-1*MONTH(_max))
return
CALCULATE(Sum(Table[Amount]), filter(Table, [Type] = "Actual") ,DATESBETWEEN('Date'[Date],_min,_max)) +
CALCULATE(Sum(Table[Amount]), filter(Table, [Type] = "Forecast") ,DATESBETWEEN('Date'[Date],_max+1,_YED))
Maybe I'm missing something but I feel like that measure filters on the right dates but doesn't take in consideration the multiple forecast loads. How does it know which load date to use?
If I select to view data from Q1 it should use the Apr-1 loaddate but if I select Q2 it should be using the Jul-1 loaddate (and so on and so forth)
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 |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |