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
summit20
Helper I
Helper I

Calcular el cambio diario con varios estados en la misma columna

Tengo una tabla que se parece a la de abajo y estoy tratando de calcular el cambio diario, pero estoy luchando porque hay varios estados. No estoy seguro de cómo comparar cada estado ya que los estados no están necesariamente en el mismo orden cada día. Solo hay 1 valor por estado cada día. Por ejemplo, para California, la fórmula debe devolver 10 (1/2/2020 a 110 - 1/1/2020 a 100). No estoy seguro de si debería hacer esto como otra columna o una medida.

FechaEstadoValor
1/1/2020California100
1/1/2020Arizona

225

1/1/2020Washington400
1/2/2020Arizona250
1/2/2020Washington445
1/2/2020California110
6 REPLIES 6
parry2k
Super User
Super User

@summit20 lo que esperas ahí? ¿El total no pertenece a un solo estado? ¿Qué se supone que es? No hay ningún concepto de día anterior en la línea total porque el día anterior depende del estado.



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.

Quería trazarlo como un gráfico de barras / líneas. Agregué todas las medidas como nuevas columnas y funcionó de esa manera. ¡Gracias!

parry2k
Super User
Super User

@summit20 usar este código, hay algún carácter adicional allí, no estoy seguro de por qué

Date =
VAR __dates = CALENDARAUTO()
RETURN
ADDCOLUMNS (
__dates,
"Year", YEAR ( [Date] ),
"Month Number", MONTH ( [Date] ),
"Month Name", FORMAT ( [Date], "MMMM" ), --use MMMM for full month name, January instead of Jan
"Month", FORMAT( [Date], "MMM, YYYY" ), --use MMMMM for full month name, January instead of Ja
"Month Sort", FORMAT( [Date], "YYYY-MM" ),
"Quarter", "Q" & FORMAT( [Date], "Q, YYYY" ),
"Quarter Sort", FORMAT ( [Date], "YYYY-Q" )
)


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.

parry2k
Super User
Super User

@summit20 asegurarse de que una dimensión de fecha/calendario en su modelo, puede agregar una de mi entrada de blog aquí y ahora agregar las siguientes medidas:

Total Value = SUM ( Table[Value] )

Total Value PD = 
CALCULATE ( 
[Total Value], 
ALLEXCEPT ( Table, Table[State] ), 
PREVIOUSDAY ( 'Calendar'[Date] ) 
) 

Daily Change = [Total Value] - [Total Value PD] 

A la tabla visual, agregue la fecha de la tabla de calendario, el estado y por encima de dos medidas y obtendrá el resultado.

Consulta mi última entrada de blog Año-2020, Pandemia, Power BI y más allá para obtener un resumen de mis versiones favoritas de las características de Power BI en 2020

Me gustaría elogios si mi solución ayudara. 👉 Si puedes dedicar tiempo a publicar la pregunta, también puedes hacer esfuerzos para dar Felicitaciones a quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



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.

El valor total pd siempre aparece en blanco. ¿Alguna idea de lo que podría estar haciendo incorrectamente?

Recibí un error cuando intenté crear tu tabla de citas. Dice que "la sintaxis de ';' es incorrecta. Esto es lo que he pegado desde su sitio.

Fecha de la fecha ?
VAR __dates - CALENDARAUTO()
devolución
ADDCOLUMNS (
__dates,
"Año", Año ( [Fecha] ),
"Número de mes", MES ( [Fecha] ),
"Mes Name", FORMAT ( [Fecha], "MMMM" ), --use MMMM para el nombre completo del mes, enero en lugar de enero
"Mes", FORMAT( [Fecha], "MMM, AAAA" ), --use MMMMM para el nombre del mes completo, enero en lugar de Ja
"Mes Ordenar", FORMAT( [Fecha], "AAAA-MM" ),
"Cuarto", "Q" & FORMAT( [Fecha], "Q, AAAA" ),
"Cuarto Ordenar", FORMAT ( [Fecha], "AAAA-Q" )
)

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.