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
Anonymous
Not applicable

SUMX e Inteligencia del Tiempo

Hola

Gracias por leer.

Estoy tratando de crear una medida utilizando SUMX. Quiero calcular en el nivel de fila un ratio * importe en dólares y resumirlo.

Los datos están en un formato similar a lo que hay a continuación, pero debido a la política de la empresa no creo que pueda publicar datos reales.

FechaProductoVendidoTotal de dólares vendidos
201901A101000
201901B161200
202001A121400
202001B161200

La medida final es algo así como

FinalMeasure = SUMX(SalesTable, [PriceChange] * [Total Dollars Sold])

Creé una medida de precio--

Price = DIVIDE(SUM(Total Dollars Sold), SUM(Sold))

A continuación, la creación de un precio del año anterior--

PYPRICE = CALCULATE([Price], SAMEPERIODLASTYEAR('YearMonthBridge'[Date]))

A continuación, una medida de cambio de precio tomando el cociente de las dos medidas anteriores.

Mientras solucionaba mi medida SUMX comencé a SUMX cada parte de la medida para determinar dónde estaba el problema. Cuando hice un SUMX de la medida PY--

SUMXPY = SUMX(SalesTable,PYPRICE)

El valor devuelto siempre es nothing/null. Todos los otros SUMX (PRICE) etc... están funcionando correctamente.

Editar-- También debería añadir. La medida PRECIO DE PY funciona correctamente por sí misma, ya que mi columna Fecha está conectada a una tabla de fechas.

¿Es posible utilizar SUMX con Time Intelligence? Estoy teniendo un tiempo difícil envolver mi cabeza alrededor de this!! Cualquier ayuda sería apreciada.

Gracias por leer

1 ACCEPTED SOLUTION
Anonymous
Not applicable
4 REPLIES 4
Anonymous
Not applicable

amitchandak
Super User
Super User

@victorq, no muy claro. Pero usted debe utilizar una tabla de fechas para la inteligencia de tiempo

Ejemplo


PYPRICE ? CALCULATE([Price], SAMEPERIODLASTYEAR('Date'[Date]))

PYPRICE á CALCULATE([Price], dateadd('Date'[Date],-1,year))

Consulte mi video sobre por qué la inteligencia de tiempo puede fallar

https://youtu.be/OBf0rjpp5Hw

https://youtu.be/j0ug-XQgZtg

Power BI — Año tras año con o sin inteligencia de tiempo
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Power BI — Mes a mes con o sin inteligencia de tiempo
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

parry2k
Super User
Super User

@victorq parece que lo estás haciendo súper complicado. ¿Cuál es tu objetivo final?

Lee este post para obtener tu respuesta rápidamente.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490...



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k Disculpas, creo que lo resolví esta mañana así que debería ser capaz de encapsular el problema.

Esta medida siguiente devuelve null:

PriceChange = SUMX(Sales Table, Divide([Price], CALCULATE([Price], SAMEPERIODLASTYEAR(YearMonthBridge[Date]))))

Cuando esta medida parece estar funcionando y produciendo el resultado esperado. ¿Para mí son los mismos?

PriceChange = 
Var Pricechange =  Divide([Price], CALCULATE([Price], SAMEPERIODLASTYEAR(YearMonthBridge[Date])))
return SUMX(Sales Table, Pricechange)

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.