Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Pude descargar el precio de las acciones de un contador en particular de Yahoo.finance. tendrá una columna de fecha y el precio de cierre de una acción (para que sea simple). habrá 5 filas de datos y luego la fecha se saltará 2 días (sat y Sol) y repetirá.
También he creado una tabla de calendario con fechas justas
A continuación, vinculo las fechas del calendario con las fechas de stock.
Cuando creo una tabla de informe con fecha de calendario en la primera columna y el precio de cierre en la segunda columna, la tabla mostrará 5 días de precio de stock y luego 2 filas de espacios en blanco.
¿Cómo puedo tener la celda en blanco 2 rellenada con el anterior
Solved! Go to Solution.
Prueba esto y mira si funciona.
1) Crear una medida de suma para el precio de la acción
Stock Price = SUM(Table[Stock Price])
2) Para rellenar los espacios en blanco
Stock Price Blank filled =
VAR _lastdate = MAXX(
FILTER(ALL(Date Table),
Date Table[Date] <= MAX(Date Table[Date])
&& NOT(ISBLANK([Stock Price]))),
Date Table[Date])
RETURN
CALCULATE([Stock Price],
FILTER(ALL(Date Table),
Date Table[Date] = _lastdate))
Proud to be a Super User!
Paul on Linkedin.
Prueba esto y mira si funciona.
1) Crear una medida de suma para el precio de la acción
Stock Price = SUM(Table[Stock Price])
2) Para rellenar los espacios en blanco
Stock Price Blank filled =
VAR _lastdate = MAXX(
FILTER(ALL(Date Table),
Date Table[Date] <= MAX(Date Table[Date])
&& NOT(ISBLANK([Stock Price]))),
Date Table[Date])
RETURN
CALCULATE([Stock Price],
FILTER(ALL(Date Table),
Date Table[Date] = _lastdate))
Proud to be a Super User!
Paul on Linkedin.
HI PaulDBrown
Esto es exactamente lo que se necesitaba. Gracias
¡Gran!
¿Puede marcar el post relevante como una solución para cerrar el hilo y ayudar a otros que buscan una solución similar?
Gracias.
Proud to be a Super User!
Paul on Linkedin.
HI Speedramp, thank for the solution, it would probably work but as we load more stocks table, this becomes very troublesome. I would prefer that we implement some DAX formula so that it is more elegant and more scaleable.
Hi again Patrick
Please consider this solution and leave kudos
Create a Calendar table with a list of all dates, the day name and day offset counter.
Create your Yahoo table of prices for each day except sat and sun.
Create a one to many relationship between calendar[date] and Yahoo[date].
Create this dax measure and create a report by calendar[date] for the measure.
It uses a CALCULATE with ALL to remove the current date context and then a offset to get Friday’s prices for sat and sun.
Note you need to improve the logic for midweek holidays.
myprice =
VAR dayofweek = SELECTEDVALUE('Calendar'[Day Of Week])
VAR offset = SELECTEDVALUE('Calendar'[DayOffset])
RETURN
SWITCH(TRUE(),
dayofweek = "Saturday",
CALCULATE(MAX(Yahoo[Price]),ALL('Calendar'),'Calendar'[DayOffset] = offset -1 ),
dayofweek = "Sunday",
CALCULATE(MAX(Yahoo[Price]),ALL('Calendar'),'Calendar'[DayOffset] = offset - 2 ),
MAX(Yahoo[Price])
)
Por favor considere esta solución.
Duplica la tabla de calendario, elimina todas las filas excepto sat y sun y elimina todas las columnas excepto la fecha.
Así que tienes una lista de sólo sentarse y salir al sol.
Llama a la mesa "Fines de semana".
Añade "Weekends" en tu mesa de Yahoo.
Ordene el bronceado por fecha.
Utilice la transformación Rellenar para rellenar los precios vacíos (para sat y sun) con el precio anterior.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
Check out the May 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |