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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
gomezc73
Helper V
Helper V

Calendario y tipo de cambio semanal

Hola

Necesito ayuda con este problema.

Tengo un informe semanal de tipo de cambio, se descarga todos los sábados..

Luego en el informe si necesito un tipo de cambio de lunes o martes por ejemplo es necesario utilizar el último tipo de cambio válido descargado.

Por ejemplo:

El tipo de cambio utilizado para el día 07/13/2020 debe ser 1.131850 (Descargado el 07/11/2020). ese es el último tipo de cambio vlid

¿Alguien sabe cómo hacerlo?

Esta es la tabla que tengo:

FechaMoneda deMoneda aDatos EN JDE Tipo de cambio
7/10/2020EurUsd
7/11/2020EurUsd7/11/2020 1.131850
7/12/2020EurUsd
7/13/2020EurUsd
7/14/2020EurUsd
7/15/2020EurUsd
7/16/2020EurUsd
7/17/2020EurUsd
7/18/2020EurUsd7/18/2020 1.142250
7/19/2020EurUsd
7/20/2020EurUsd
7/21/2020EurUsd
7/22/2020EurUsd
7/23/2020EurUsd
7/24/2020EurUsd
7/25/2020EurUsd7/25/2020 1.162550

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@gomezc73 , Busque el archivo adjunto con la solución.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@gomezc73 , Busque el archivo adjunto con la solución.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hello, I tried using

 

New exchange Rate = maxx(filter('Table', [Date]<=EARLIER('Table'[Date])),LASTNONBLANKVALUE('Table'[Date IN JDE],max('Table'[ Exchange Rate ])))
 
And it works only with a "Currency From", By Example if the tables is only From EUR to USD.
 
But when i added other Currencys in the tables the formula doesn't work. It bring the MAX Exchange rates From other Currencys.. 
 
How The formula can be improve to consider the "Currency From"?
 

Perfect!!!. That's just what i needed.. You are a genious!!
Ashish_Mathur
Super User
Super User

Hola

En el informe que se descarga todos los sábados, ¿hay una columna "Fecha de descarga"?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hola,

 

Si, la primera columna es la fecha calendario y la cuarta columna es la fecha en la que se obtuvo la Tasa de cambio.

 

cuando hago la busqueda por

  • la fecha calendario,
  • moneda DESDE y
  • MONEDA HASTA,

solo me consigue la tasa de cambio de los sabados y el resto de dias queda en blanco, asi que necesito repetir esa tasa de cambio para los dias siguientes, hasta que consiga la tasa de cambio del siguiente sabado y asi sucesivamente.

 

Calendar DateCurrency FromCurrency ToDownload Date Exchange Rate 
1/6/2018AEDUSD1/6/2018             0.272300
1/7/2018AEDUSD              0.272300
1/8/2018AEDUSD              0.272300
1/9/2018AEDUSD              0.272300
1/10/2018AEDUSD              0.272300
1/11/2018AEDUSD              0.272300
1/12/2018AEDUSD              0.272300
1/13/2018AEDUSD1/13/2018             0.272300
1/14/2018AEDUSD              0.272300
1/15/2018AEDUSD              0.272300
1/16/2018AEDUSD              0.272300
1/17/2018AEDUSD              0.272300
1/18/2018AEDUSD              0.272300
1/19/2018AEDUSD              0.272300
1/20/2018AEDUSD1/20/2018             0.272300

 

@gomezc73- ¿Puede usar Fill Down in Power Query? De lo contrario, si está haciendo una columna, podría hacer algo como:

Final Exchange Rate =
  IF(
    [Exchange Rate] <> "",
    [Exchange Rate],
    VAR __Date = MAXX(FILTER('Table',[Calendar Date] < EARLIER([Calendar Date]) && [Currency From] = EARLIER([Currency From]) && [Currency To] = EARLIER([Currency To]) && [Exchange Rate] <> ""),[Calendar Date])
    RETURN MAXX(FILTER('Table',[Calendar Date] = __Date),[Exchange Rate])

De alguna manera, sin embargo, no estoy seguro de que todos estemos empezando desde el mismo lugar que tú.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@gomezc73 - Básicamente estás mirando Lookup Min/Max tipo de - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434

En su caso,

Measure =
  VAR __Date = MAX('Table'[Date])
  VAR __RateDate = MAXX(FILTER('ExchangeRates',[Date]<=__Date && [Exchange Rate] <> ""),[Date])
RETURN
  MAXX(FILTER('ExchangeRates',[Date] = __RateDate),[Exchange Rate])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors