Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hello,
I tfeels like I have a weird issue and I hope I am missing something simple.
So I have two measures. The first calculates the revenue for each month as long as the start date is equal to or before the last day of the month and the end date is greater than the last day of the month.
The second is designed to capture forecast so needs to assume that the end date doesn't come. So it has the end date fixed to the 31st Jan 2025. My challenge is that when I look at January 2025 in the output this should then have exactly the same value in both. But it doesn't:
Of course if I change the date in Forecast MRR to 'MaxDate' then the numbers match. I even verified that MAX was indeed looking at the 31st Jan for it.
MRR Revenue =
VAR BaseTable = SUMMARIZE( 'GBP', 'Dates2'[Month Year], 'GBP'[Source], 'GBP'[Rate] )
VAR ConvertedValueGBP = SUMX(
BaseTable,
VAR MaxDate = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Source = 'GBP'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR] ),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDate,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'GBP'[Rate]
RETURN Result
)
VAR BaseTable2 = SUMMARIZE( 'EUR', 'Dates2'[Month Year], 'EUR'[Source], 'EUR'[Rate] )
VAR ConvertedValueEUR = SUMX(
BaseTable2,
VAR MaxDate = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Source = 'EUR'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR]),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDate,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'EUR'[Rate]
RETURN Result
)
VAR UnconvertedValue = SUMX( VALUES( Dates2[Month Year] ),
VAR MaxDate = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Result = CALCULATE(
SUM( Combined[MRR $] ),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDate,
Combined[PON or Not] IN { "PON", "Excluded" },
ISBLANK( Combined[Currency] )
)
RETURN Result
)
VAR Result = ConvertedValueGBP + UnconvertedValue + ConvertedValueEUR
RETURN Result
and:
Forecast MRR =
VAR BaseTable = SUMMARIZE( 'GBP', 'Dates2'[Month Year], 'GBP'[Source], 'GBP'[Rate] )
VAR ConvertedValueGBP = SUMX(
BaseTable,
VAR MaxDate = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Source = 'GBP'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR] ),
Combined[End Date] > date(2025,1,31),
Combined[Start Date] <= MaxDate,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'GBP'[Rate]
RETURN Result
)
VAR BaseTable2 = SUMMARIZE( 'EUR', 'Dates2'[Month Year], 'EUR'[Source], 'EUR'[Rate] )
VAR ConvertedValueEUR = SUMX(
BaseTable2,
VAR MaxDate = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Source = 'EUR'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR]),
Combined[End Date] > date(2025,1,31),
Combined[Start Date] <= MaxDate,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'EUR'[Rate]
RETURN Result
)
VAR UnconvertedValue = SUMX( VALUES( Dates2[Month Year] ),
VAR MaxDate = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Result = CALCULATE(
SUM( Combined[MRR $] ),
Combined[End Date] > date(2025,1,31),
Combined[Start Date] <= MaxDate,
Combined[PON or Not] IN { "PON", "Excluded" },
ISBLANK( Combined[Currency] )
)
RETURN Result
)
VAR Result = ConvertedValueGBP + UnconvertedValue + ConvertedValueEUR
RETURN Result
.
Do you have any thoughts or ideas please?
Thanks
Think I just got closer. I think the random months working was due to it not knowing which months / year were greater than Jan 2025. So i did the same but matched on a yearmonth formula column and now all looks good apart from Jan bizarely:
Forecast MRR =
VAR BaseTable = SUMMARIZE( 'GBP', 'Dates2'[Month Year], 'GBP'[Source], 'GBP'[Rate] )
VAR ConvertedValueGBP = SUMX(
BaseTable,
VAR MaxDate = IF(MAX('Dates2'[Month Year Formula]) >= "202501", DATE(2025,1,31), CALCULATE( MAX( 'Dates2'[Date] ) ))
VAR MaxDateStart = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Source = 'GBP'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR] ),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDateStart,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'GBP'[Rate]
RETURN Result
)
VAR BaseTable2 = SUMMARIZE( 'EUR', 'Dates2'[Month Year], 'EUR'[Source], 'EUR'[Rate] )
VAR ConvertedValueEUR = SUMX(
BaseTable2,
VAR MaxDate = IF(MAX('Dates2'[Month Year Formula]) >= "202501", DATE(2025,1,31), CALCULATE( MAX( 'Dates2'[Date] ) ))
VAR MaxDateStart = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Source = 'EUR'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR]),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDateStart,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'EUR'[Rate]
RETURN Result
)
VAR UnconvertedValue = SUMX( VALUES( Dates2[Month Year] ),
VAR MaxDate = IF(MAX('Dates2'[Month Year Formula]) >= "202501", DATE(2025,1,31), CALCULATE( MAX( 'Dates2'[Date] ) ))
VAR MaxDateStart = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Result = CALCULATE(
SUM( Combined[MRR $] ),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDateStart,
Combined[PON or Not] IN { "PON", "Excluded" },
ISBLANK( Combined[Currency] )
)
RETURN Result
)
VAR Result = ConvertedValueGBP + UnconvertedValue + ConvertedValueEUR
RETURN Result
Actually not quite square one. Some random months seem ok.
@Lodan Try using
MRR Revenue =
VAR BaseTable = SUMMARIZE( 'GBP', 'Dates2'[Month Year], 'GBP'[Source], 'GBP'[Rate] )
VAR ConvertedValueGBP = SUMX(
BaseTable,
VAR MaxDate = IF(MAX('Dates2'[Month Year]) = "Jan 2025", DATE(2025,1,31), CALCULATE( MAX( 'Dates2'[Date] ) ))
VAR Source = 'GBP'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR] ),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDate,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'GBP'[Rate]
RETURN Result
)
VAR BaseTable2 = SUMMARIZE( 'EUR', 'Dates2'[Month Year], 'EUR'[Source], 'EUR'[Rate] )
VAR ConvertedValueEUR = SUMX(
BaseTable2,
VAR MaxDate = IF(MAX('Dates2'[Month Year]) = "Jan 2025", DATE(2025,1,31), CALCULATE( MAX( 'Dates2'[Date] ) ))
VAR Source = 'EUR'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR]),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDate,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'EUR'[Rate]
RETURN Result
)
VAR UnconvertedValue = SUMX( VALUES( Dates2[Month Year] ),
VAR MaxDate = IF(MAX('Dates2'[Month Year]) = "Jan 2025", DATE(2025,1,31), CALCULATE( MAX( 'Dates2'[Date] ) ))
VAR Result = CALCULATE(
SUM( Combined[MRR $] ),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDate,
Combined[PON or Not] IN { "PON", "Excluded" },
ISBLANK( Combined[Currency] )
)
RETURN Result
)
VAR Result = ConvertedValueGBP + UnconvertedValue + ConvertedValueEUR
RETURN Result
Proud to be a Super User! |
|
Hey, I thought that was looking promising. I did change the formula for 'Start Date' so it had its own variable.
That fixed for Jan but then the rest of the months of the year followed the previous formula. So I thought it might work if I change the ="Jan 2025" to >="Jan 2025" but that took me back to square 1.
Forecast MRR =
VAR BaseTable = SUMMARIZE( 'GBP', 'Dates2'[Month Year], 'GBP'[Source], 'GBP'[Rate] )
VAR ConvertedValueGBP = SUMX(
BaseTable,
VAR MaxDate = IF(MAX('Dates2'[Month Year]) >= "Jan 2025", DATE(2025,1,31), CALCULATE( MAX( 'Dates2'[Date] ) ))
VAR MaxDateStart = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Source = 'GBP'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR] ),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDateStart,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'GBP'[Rate]
RETURN Result
)
VAR BaseTable2 = SUMMARIZE( 'EUR', 'Dates2'[Month Year], 'EUR'[Source], 'EUR'[Rate] )
VAR ConvertedValueEUR = SUMX(
BaseTable2,
VAR MaxDate = IF(MAX('Dates2'[Month Year]) >= "Jan 2025", DATE(2025,1,31), CALCULATE( MAX( 'Dates2'[Date] ) ))
VAR MaxDateStart = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Source = 'EUR'[Source]
VAR Result = CALCULATE(
SUM( Combined[MRR]),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDateStart,
Combined[PON or Not] IN { "PON", "Excluded" },
Combined[Currency] = Source
) * 'EUR'[Rate]
RETURN Result
)
VAR UnconvertedValue = SUMX( VALUES( Dates2[Month Year] ),
VAR MaxDate = IF(MAX('Dates2'[Month Year]) >= "Jan 2025", DATE(2025,1,31), CALCULATE( MAX( 'Dates2'[Date] ) ))
VAR MaxDateStart = CALCULATE( MAX( 'Dates2'[Date] ) )
VAR Result = CALCULATE(
SUM( Combined[MRR $] ),
Combined[End Date] > MaxDate,
Combined[Start Date] <= MaxDateStart,
Combined[PON or Not] IN { "PON", "Excluded" },
ISBLANK( Combined[Currency] )
)
RETURN Result
)
VAR Result = ConvertedValueGBP + UnconvertedValue + ConvertedValueEUR
RETURN Result
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!