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
Syndicate_Admin
Administrator
Administrator

Accrued by identifier and reset the account by month

I need to accumulate "Hours" from the Detail table and reset by months.

I've created the month column based on the date and sorted by Date from lowest to highest

Mes = MONTH([Fecha])

I have used the following measure:

Acumulado = 
CALCULATE(
	SUM('Detalle'[Horas]),
	FILTER(
		ALLSELECTED('Detalle'[identificador]),
		ISONORAFTER('Detalle'[identificador], MAX('Detalle'[identificador]), DESC)
	)
)

It accumulates well, but I don't know how to indicate that I reset the accumulated when I changed the month.

miquinti_0-1703146194722.png

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

I've solved it as follows:

Acumulado  = 
CALCULATE (
    SUM ( 'Detalle'[Horas] ),
    FILTER (
        ALLSELECTED ( 'Detalle' ),
        'Detalle'[identificador] <= MAX ( 'Detalle'[identificador] )
             && 'Detalle'[Mes] = MAX ( 'Detalle'[Mes]
    )
))

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

I've solved it as follows:

Acumulado  = 
CALCULATE (
    SUM ( 'Detalle'[Horas] ),
    FILTER (
        ALLSELECTED ( 'Detalle' ),
        'Detalle'[identificador] <= MAX ( 'Detalle'[identificador] )
             && 'Detalle'[Mes] = MAX ( 'Detalle'[Mes]
    )
))

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.