Forum Discussion

Lodan's avatar
Lodan
Helper II
1 year ago
Solved

Using exchange rates

Hello,   Today I have a visual that calculated the sum of the total MRR as long as the start date is before and the end date is after.  It is linked to the dates table so it does is on a monthly ba...
  • johnt75's avatar
    1 year ago

    You need to make a couple of changes in your model. First, change the type of the [MRR] column to a decimal number. Also link 'Date'[Date] to 'Exchange Rates'[Time Period]. Then you can create a measure like

    MRR Revenue Converted = 
    VAR BaseTable = SUMMARIZE( 'Exchange Rates', 'Dates2'[Month Year], 'Exchange Rates'[Source], 'Exchange Rates'[Rate] )
    VAR ConvertedValue = SUMX(
    	BaseTable,
    	VAR MaxDate = CALCULATE( MAX( 'Dates2'[Date] ) )
    	VAR Source = 'Exchange Rates'[Source]
    	VAR Result = CALCULATE(
    		SUM( TblCombinedx[MRR] ),
    		TblCombinedx[Calculated End Date] > MaxDate,
            TblCombinedx[(estimated) (billing) start date] <= MaxDate,
            TblCombinedx[PON/Other] IN { "PON", "Excluded" },
    		TblCombinedx[Currency] = Source
    	) * 'Exchange Rates'[Rate]
    	RETURN Result
    )
    VAR UnconvertedValue = SUMX( VALUES( Dates2[Month Year] ),
    	VAR MaxDate = CALCULATE( MAX( 'Dates2'[Date] ) )
    	VAR Result = CALCULATE(
    		SUM( TblCombinedx[MRR] ),
    		TblCombinedx[Calculated End Date] > MaxDate,
            TblCombinedx[(estimated) (billing) start date] <= MaxDate,
            TblCombinedx[PON/Other] IN { "PON", "Excluded" },
    		ISBLANK( TblCombinedx[Currency] )
    	)
    	RETURN Result
    )
    VAR Result = ConvertedValue + UnconvertedValue
    RETURN Result
    
  • johnt75's avatar
    johnt75
    1 year ago

    The line

    TblCombinedx[Currency] = Source

    makes sure that it is the correct currency.