Forum Discussion
Bokazoit
Continued Contributor
10 months agoMeasure to use different values depending on dates
I have this data model: One measure for the table FactFinans: SUM('FactFinans (HF)'[#Bogførtbeløb])*-1 And another measure for FactEstimat: Sum('FactEstimat (HF)'[#Estimat]) Dependi...
- 10 months ago
Combined Amount =
VAR EstimatQuarter = MID(MAX('FactEstimat (HF)'[Estimat version]), 2, 1) * 1
VAR EstimatYear = MID(MAX('FactEstimat (HF)'[Estimat version]), 4, 4)
VAR EndMonth = SWITCH(TRUE(), EstimatQuarter = 2, 3, EstimatQuarter = 3, 6, EstimatQuarter = 4, 9)
VAR ActualFinansDate = EOMONTH(DATE(EstimatYear, EndMonth, 1), 0)
RETURN
CALCULATE(
SUM('FactFinans (HF)'[#Bogførtbeløb]) * -1,
'FactFinans (HF)'[Financial Date] <= ActualFinansDate
) +
CALCULATE(
SUM('FactEstimat (HF)'[#Estimat]),
'FactEstimat (HF)'[Financial Date] > ActualFinansDate
)
v-veshwara-msft
Community Support
10 months agoHi Bokazoit ,
Just checking in to see if you had a chance to go through the response shared by Kedar_Pande .
Let us know if you need any additional clarification or have further queries.