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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Adding Last data point label to a 12mth Calculation

Hi,

 

I have managed to setup a 12mth rolling measure that calulates a frequency rate of injuries against hours:

  • '12mth TRIFR' = '12mth injury count' * 1000000 / '12mth hours'
    • '12mth injury count' = CALCULATE ( SUM ( MonthEnd[TRI] ), DATESINPERIOD (MonthEnd[Date], VALUES ( MonthEnd[Date] ), -12, MONTH )
    • '12mth hours' = CALCULATE ( SUM ( MonthEnd[Hours] ), DATESINPERIOD (MonthEnd[Date], VALUES ( MonthEnd[Date] ), -12, MONTH )

This all plots as i would expect with the correct values.

 

I was able to find guides on how to show the last data point but everything i try doesnt give me the correct answer. What i get is the the most recent TRFIR but its based of 1 month of data rather than a 12mth (which i am sure if based on the filter of the current month). So my approach appears to stifle my result as well as giving me a single data label.

 

Is there anyway to get the 12mth calculation to work as well as only show the last data point?

 

Thanks,

 

Darren

1 REPLY 1
lbendlin
Super User
Super User

@Anonymous I am surprised that your VALUES() part doesn't throw an error. The second parameter of DATESINPERIOD expects a single start date. Maybe VALUES() returns a single row table.

 

Please provide sanitized sample data in usable format (not as a picture - inserting it into a table would be good) and show the expected outcome.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.