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
abhayrnjn
Frequent Visitor

Average monthly currency exchange rate from daily exchange rate in Power BI

Hello All,

 

I want to create a calculate column where just want to create average monthly currency exchange rate from daily.

 

Please see screeshot below where we have daily average currency exchange rate and also here you will see single currency in FROMCURRENCY and the same in TOCURRENCY but we have multiple currencies in both the columns.

abhayrnjn_0-1656600841265.png

 

Below is the expected result to be shown.

abhayrnjn_2-1656601201638.png

 

Can anyone help me on this?

 

Thanks

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @abhayrnjn ,

 

On the Query Editor Select the Group by and then do the grouping by:

  • Group:
    • FromCrurrency
    • ToCurrency
  • Aggregation
    • Average Rate
    • Max Date

 

 

MFelix_0-1656929504912.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
abhayrnjn
Frequent Visitor

Hi @MFelix,

 

I tried your solution but didn't work to me. So i had used below dax to get the expected result.

 

Monthly Average Rate =
var CurrentDate = ExchangeRateEntityStaging[STARTDATE]
var CurrentFrom = ExchangeRateEntityStaging[FROMCURRENCY]
var CurrentTo = ExchangeRateEntityStaging[TOCURRENCY]
Var MinDate = EOMONTH( CurrentDate, -1) + 1
Var MaxDate = EOMONTH( CurrentDate, 0 )
var Result =
AVERAGEX(
FILTER(
ExchangeRateEntityStaging, true
&& ExchangeRateEntityStaging[FROMCURRENCY] = CurrentFrom
&& ExchangeRateEntityStaging[TOCURRENCY] = CurrentTo
&& MinDate <= ExchangeRateEntityStaging[STARTDATE]
&& ExchangeRateEntityStaging[STARTDATE] <= MaxDate
),
ExchangeRateEntityStaging[RATE]
)
return
Result

 

Thanks for your help.

 

 

MFelix
Super User
Super User

Hi @abhayrnjn ,

 

On the Query Editor Select the Group by and then do the grouping by:

  • Group:
    • FromCrurrency
    • ToCurrency
  • Aggregation
    • Average Rate
    • Max Date

 

 

MFelix_0-1656929504912.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.