Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Syndicate_Admin
Administrator
Administrator

Help (I need to calculate cumulative data)

Hello everyone

I'm putting together a panel and I need to have the accumulated data (YTD). I don't know how I can do it. I have the following formula (these are words)

I have 2 measures:

CTP = CALCULATE(COUNTROWS(BD_SAP),BD_SAP[Type of injury] = "WITH LOST TIME") ---> in this formula I look for all accidents with lost time.
IF = [CTP]*1000000/SUM(HH[HH])+0 ---> after the previous formula multiplied it by 1000000/ sum of the hours worked.
The problem that happens to me that the result of the if does not accumulate
Jos_Valds_0-1627443295086.png

(the blue line is the if)

Thanks a lot

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

I'd like to suggest you use allselected filters on the fact table and use the current calendar date as conditions to filter on records.

if_acumlado =
CALCULATE (
    [IF],
    FILTER ( ALLSELECTED ( 'Fact' ), 'fact'[Date] <= MAX ( 'date'[Date] ) )
)

If the above not help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,
Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Thanks for the answer, but I tell you that I have created the calendar table connected with the other tables, but when making the formula, I only see values in 0.

occupy the following formula:

if_acumlado = calculate([IF],filter(ALLSELECTED('date'),'date'[Date]<=max('date'[Date])))
Jos_Valds_0-1627446753075.png

(In blue the if field)

I don't realize I'm doing wrong.

Anonymous
Not applicable

Hi @Anonymous,

I'd like to suggest you use allselected filters on the fact table and use the current calendar date as conditions to filter on records.

if_acumlado =
CALCULATE (
    [IF],
    FILTER ( ALLSELECTED ( 'Fact' ), 'fact'[Date] <= MAX ( 'date'[Date] ) )
)

If the above not help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,
Xiaoxin Sheng

amitchandak
Super User
Super User

@Syndicate_Admin , where is cumulative logic 

 

Both with help from date table and column on axis come from date table, Assume IF is the measure used

 

calculate([IF], datesytd('Date'[Date]))

 

calculate([IF], filter(allselected('Date'),'Date'[Date] <= max('Date'[Date])))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors