Forum Discussion
Sum Values in Matrix based in another value in that matrix
- 9 months ago
Hey MRoth ,
have fun.I will no longer work on this, because I consider the provided information lacking, and for this reason, I'm wasting my precious spare time.
Regards,
Tom
Hey MRoth ,
despite my last questions from a little earlier, I think this measure is doing the trick regarding the Forcasted Value:
tom forecasted value =
// offset value
var currentOffset = SELECTEDVALUE( 'Offset'[Parameter] )
return
CALCULATE(
sum( 'Forecasts'[Forecasted Value] ),
OFFSET(
CurrentOffset * -1,
SUMMARIZE(ALLSELECTED('Forecasts'), 'Dim Forecasts'[ForecastVersion], 'Forecasts'[ForcastWeek]),
ORDERBY('Forecasts'[ForcastWeek]),
KEEP,
PARTITIONBY('Dim Forecasts'[ForecastVersion])
)
)
Please be aware that I changed the data type of Forecasts[ForecastsWeek] to "whole number"; otherwise, the ORDERBY clause in the OFFSET function will order the weeks alphabetically.
At least the results look reasonable 😉
Hopefully, this helps to tackle your challenge.
Regards,
Tom
- MRoth9 months ago
Helper I
Hi TomMartens ,
appologies, it's been a few days until I had capacity to look at your reply.
Unfortunately not quite the result I am hoping for.
Your big table on the right shows multiple forecast versions per week, therefore your result in the left table is for Forecasted Value is the sum of all those weeks, even the ones that I didn't want to consider.
Your right table should look like this
So that the sum of ForecastedValue, per (Used)ForecastVersion only considers the weeks where that version was 'active'.
Based on my example,F1 2025 = 4026
F2 2025 = 4442
and so on...Thanks
Marius- TomMartens9 months ago
Super User
Hey MRoth,
how do I know when a version is active?
How does the Offset value affect this, given the expected value for the Forecast Version of F1 2025?
Please describe the underlying rule without using DAX.
What role plays the Calendar table?
Regards,
Tom - TomMartens9 months ago
Super User
Hey MRoth ,
have fun.I will no longer work on this, because I consider the provided information lacking, and for this reason, I'm wasting my precious spare time.
Regards,
Tom- MRoth9 months ago
Helper I
Hi TomMartens,
this one works. Thanks so much!