I'm trying to create a measure which can give me the primo date value for a given timeframe eg. start date of: current month, current year, YTD etc, I'm using calculation groups, but i've boiled the problem down to this.
In this example i'm tying to find the value of the stat date of current YTD-period, which should be 01/01/2022 :
primotest =
var primoDateValue = TOTALYTD(
FIRSTDATE( Dato[FuldDato])
, Dato[FuldDato]
)
//in my actual measure i have to filter the primoDateValue by [level2]-column, which i why it is important to include it in this example.
var randomMeasure =
CALCULATE(1
,'Dim funktionsbudgetter'[level2] = "this doesn't matter"
)
return
primoDateValue
for some unknown and really weird reason the randomMeasure interacts with the primoDateValue measure.
if 'Dim funktionsbudgetter'[level2] = "this doesn't matter" is included in randomMeasure. the result is incorrect
if I remove ''Dim funktionsbudgetter'[level2] = "this doesn't matter" the value is correct
I'm guessing that i have somekind of problem with my datamodel. but no matter what that problem is. I can't think of a single scenario that causes an interaction between primoDateValue and randomMeasure.
I'm hoping that some of you can think up a scenario that would cause the weird interaction between the measures. so that I can figure out where the problem actually is.


