Reply
gizattos
Regular Visitor
Syndicated - Inbound

Suma por número de semana

Source Community: Power BI

Hola, chicos

Estoy tratando de crear una columna basada en el valor de la semana pasada con DAX, ya creo la columna weeknumber. He intentado este código :

valor de la última semana• CALCULATE(SUMX(Table,Table[Insight]),FILTER(ALL(Table),Table[weeknumber]-1))

Pero la columna muestra la suma de toda la tabla, y quiero algo como esto:

visiónnúmero de semanavalor de la última semana
1103
1103
1103
191
191
191
180
080

9 REPLIES 9
amitchandak
Super User
Super User

Source Community: Power BI
Syndicated - Inbound

@gizattos , consulte esto para WOW

https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Tahreem24
Super User
Super User

Source Community: Power BI
Syndicated - Inbound

@gizattos ,

También puede probar esta fórmula también:

Medida: SUMX(FILTER(ALL(Table),Sheet12[Weeknum]-MAX(Table[Weeknum])-1),Table[Insight])
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Source Community: Power BI
Syndicated - Inbound

@Tahreem24

As una medida que funciona !

i¿hay una manera de crear columnas de esa manera?

Source Community: Power BI
Syndicated - Inbound

@gizattos ,

Pruebe el siguiente COlumn DAX:

Columna: CALCULATE(SUM(Table[Insight]),FILTER(ALL(Table),Table[Weeknum]-MAX(Table[Weeknum])-1),Table[Insight])
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
v-jayw-msft
Community Support
Community Support

Source Community: Power BI
Syndicated - Inbound

Hola @gizattos ,

Puede utilizar la función EARLIER()

Column = CALCULATE(SUM('Table'[insight]),FILTER('Table','Table'[weeknumber]=EARLIER('Table'[weeknumber])-1))

3.PNG

Saludos

Jay

Equipo de apoyo a la comunidad _ Jay Wang

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Tahreem24
Super User
Super User

Source Community: Power BI
Syndicated - Inbound

@gizattos ,

También puede probar esta fórmula también:

Medida: SUMX(FILTER(ALL(Sheet12),Sheet12[Weeknum]-MAX(Sheet12[Weeknum])-1),Sheet12[Insight])
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Tahreem24
Super User
Super User

Source Community: Power BI

@gizattos ,

Pruebe la siguiente medida DAX:

Medida: CALCULATE(SUM(Sheet12[Insight]),FILTER(ALL(Sheet12),Sheet12[Weeknum]-MAX(Sheet12[Weeknum])-1))
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
ryan_mayu
Super User
Super User

Source Community: Power BI
Syndicated - Inbound

@gizattos

Por favor, pruebe el DAX a continuación para ver si esto funciona para usted

lastweek value = 

VAR d = max(tabela[weeknumber])
RETURN CALCULATE(SUMX(Tabela,Tabela[Insight]),FILTER(ALL(Tabela),Tabela[weeknumber]=d-1))





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

Proud to be a Super User!




Source Community: Power BI
Syndicated - Inbound

no funcionó, ahora tengo la suma de una semana específica repetida para todas las filas.

avatar user

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)