Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Kelvindaloo
New Member

Calculate YTD Value multiple by YTD month exchange rate.

Dear BI Community,

 

I need help on calculating YTD value * YTD month exchange rate.
Instead of the current one I'm using, the value was mutliple by the same month exchange rate

Current Dax Calculation:
Actual =
IF(
    Contains(Conversion,Conversion[Conversion],"Japanese Yen"),
    CALCULATE(SUMX(FSConso,FSConso[Value]*FSConso[Rate]),FSConso[Data Type(Name)]="Actual"),
    CALCULATE(SUM(FSConso[Value]),FSConso[Data Type(Name)]="Actual")
)
 

This is the FSConso table that I'm using:
Data Type(Name) is to determine if the data is Actual or Budget
Currency is to dermine which currency to use, as FSConso includes more than 1 country.

image.png


Output Visual: 

Kelvindaloo_0-1683084411362.png

 



1 ACCEPTED SOLUTION

Hi @Kelvindaloo ,

 

Due to I don't know your data model, here I will give you some advice about measure code.

Actual =
VAR _PART1 =
    CALCULATE (
        SUM ( FSConso[Value] ),
        FILTER ( ALL ( FSConso ), FSConso[Data Type(Name)] = "Actual" )
            && FSConso[RELATED COLUMN] = MAX ( Conversion[RELATED COLUMN] )
            && FSConso[Date] <= MAX ( FSConso[Date] )
            && FSConso[Date]
                >= EOMONTH ( MAX ( FSConso[Date] ), -13 ) + 1
    )
        * CALCULATE (
            SUM ( FSConso[Rate] ),
            FILTER ( ALL ( FSConso ), FSConso[Data Type(Name)] = "Actual" )
        )
VAR _PART2 =
    CALCULATE ( SUM ( FSConso[Value] ), FSConso[Data Type(Name)] = "Actual" )
RETURN
    IF (
        CONTAINS ( Conversion, Conversion[Conversion], "Japanese Yen" ),
        _PART1,
        _PART2
    )

If this reply still couldn't help you solve your issue, please share a sample file with me and show me a screenshot with the result you want.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Kelvindaloo
New Member

bump.. looking for some advise. 

Hi @Kelvindaloo ,

 

Due to I don't know your data model, here I will give you some advice about measure code.

Actual =
VAR _PART1 =
    CALCULATE (
        SUM ( FSConso[Value] ),
        FILTER ( ALL ( FSConso ), FSConso[Data Type(Name)] = "Actual" )
            && FSConso[RELATED COLUMN] = MAX ( Conversion[RELATED COLUMN] )
            && FSConso[Date] <= MAX ( FSConso[Date] )
            && FSConso[Date]
                >= EOMONTH ( MAX ( FSConso[Date] ), -13 ) + 1
    )
        * CALCULATE (
            SUM ( FSConso[Rate] ),
            FILTER ( ALL ( FSConso ), FSConso[Data Type(Name)] = "Actual" )
        )
VAR _PART2 =
    CALCULATE ( SUM ( FSConso[Value] ), FSConso[Data Type(Name)] = "Actual" )
RETURN
    IF (
        CONTAINS ( Conversion, Conversion[Conversion], "Japanese Yen" ),
        _PART1,
        _PART2
    )

If this reply still couldn't help you solve your issue, please share a sample file with me and show me a screenshot with the result you want.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Kelvindaloo
New Member

Kelvindaloo_0-1683177922281.png

This is my seperate exchange rate table

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.