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

Recuento acumulado por semana

Hola usuarios de Power BI,

Estoy teniendo un problema con el conteo acumulativo por semana. Aquí están los datos de muestra en los que estoy trabajando:

Sample DataDatos de muestra

Esto muestra las entradas abiertas en una fecha y sus correspondientes week_number.

Queremos trazar los datos en el nivel de semana con recuento acumulado como este:

Output1Salida1

Cualquier ayuda sería muy apreciada.

Gracias

@Greg_Deckler @mahoneypat @edhans

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@DeepakJha23 - Podría crear una medida como esta:

Cumulative Count =
  VAR __Week = MAX('Table'[Week_Num(Date)])
RETURN
  SUMX(FILTER('Table',[Week_Num(Date)]<=__Week),[TicketCount])

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

FrankAT
Community Champion
Community Champion

Hola @DeepakJha23

aquí está mi solución. Está muy cerrado a @Greg_Deckler solución:

02-09-_2020_13-26-14.png

Sum of Ticket Count = SUM('Table'[Ticket Count])

Cumulative Count = 
CALCULATE(
    [Sum of Ticket Count],
    FILTER(
        ALL('Table'),
        'Table'[Week_Num(Date)] <= MAX('Table'[Week_Num(Date)])
    )
)

Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

View solution in original post

3 REPLIES 3
FrankAT
Community Champion
Community Champion

Hola @DeepakJha23

aquí está mi solución. Está muy cerrado a @Greg_Deckler solución:

02-09-_2020_13-26-14.png

Sum of Ticket Count = SUM('Table'[Ticket Count])

Cumulative Count = 
CALCULATE(
    [Sum of Ticket Count],
    FILTER(
        ALL('Table'),
        'Table'[Week_Num(Date)] <= MAX('Table'[Week_Num(Date)])
    )
)

Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

amitchandak
Super User
Super User

@DeepakJha23, ya que tiene fecha puede usar un calendario de fechas y medir como este (puede tener tabla de semana con fecha de semana)

. Asegúrese de que la semana se toma de la tabla de la semana

Ejemplo

Ventas de Cumm: CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <-maxx(date,date[date]))
Ventas de Cumm: CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <-max(Sales[Sales Date]))

Ventas de Cumm: CALCULATE(SUM(Sales[Sales Amount]),filter(Week,Week[Week] <-maxx(Week,Week[Week])))
Ventas de Cumm: CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(Week),Week[Week] <-maxx(Week,Week[Week])))

también se refieren

https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únete a ella con la columna de fecha de tus hechos. recomienda:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Vea si mi seminario web sobre Time Intelligence puede ayudar: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Apreciamos tus Felicitaciones.

Greg_Deckler
Super User
Super User

@DeepakJha23 - Podría crear una medida como esta:

Cumulative Count =
  VAR __Week = MAX('Table'[Week_Num(Date)])
RETURN
  SUMX(FILTER('Table',[Week_Num(Date)]<=__Week),[TicketCount])

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.