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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
eszimmerman
Regular Visitor

Measures - Leading Indicators & Future Forecasting

I'm working on getting printer metrics for my company's network fleet and I've run into a bit of a snag.
 
I can get trailing indicators just fine, but can't seem to get leading going. The metrics are recorded every 30 minutes until they get stored as a historical metric on the 20th of every month.
 
Here's the measure I'm using:
 
  1. B&W MTD =
  2. VAR __PREVIOUSMONTH =
  3. (TOTALMTD
  4. (
  5. SUM('printerMeterHistory'[B&W]),
  6. DATEADD('printerMeterHistory'[pmh_detailedMeterReadDate].[Date], -1, MONTH)))
  7. VAR __CURRENTMONTH =
  8. (TOTALMTD
  9. (
  10. SUM('printerMeterHistory'[B&W]),
  11. DATEADD('printerMeterHistory'[pmh_detailedMeterReadDate].[Date], 0, MONTH)))
  12. VAR __NOW =
  13. (TOTALMTD
  14. (
  15. SUM('printerMeterHistory'[B&W]),
  16. DATEADD('printerMeterHistory'[pmh_detailedMeterReadDate].[Date], 0, DAY)))
  17. VAR __DIFFERENCE =
  18. IF((__CURRENTMONTH - __PREVIOUSMONTH >= 0), __CURRENTMONTH - __PREVIOUSMONTH, __CURRENTMONTH)
  19. RETURN __DIFFERENCE
2 REPLIES 2
eszimmerman
Regular Visitor

I've got it down a bit further... any asistance appreciated.  Thanks!

  1. B&W MTD =
  2. VAR __PREVIOUSMONTH =
  3. (TOTALMTD ( SUM('printerMeterHistory'[B&W]), DATEADD('printerMeterHistory'[pmh_detailedMeterReadDate].[Date], -1, MONTH)))
  4. VAR __CURRENTMONTH =
  5. (TOTALMTD ( CALCULATE( (MAX('printerMeterHistory'[pmh_detailedMeterReadDate], DATEADD('printerMeterHistory'[pmh_detailedMeterReadDate].[Date], 0, DAY) ) )
  6. VAR __TOTAL = IF((__CURRENTMONTH - __PREVIOUSMONTH >= 0), __CURRENTMONTH - __PREVIOUSMONTH, __CURRENTMONTH)
  7. RETURN __TOTAL

Getting there...

 

B&W MTD =
VAR __PREVIOUSMONTH =
(TOTALMTD ( SUM('printerMeterHistory'[B&W]), DATEADD('printerMeterHistory'[pmh_detailedMeterReadDate].[Date], -1, MONTH)))
VAR __CURRENTMONTH =
(TOTALMTD ( CALCULATE( (MAX( printerMeterHistory[pmh_detailedMeterReadDate].[Date] ) ) )
VAR __TOTAL = IF((__CURRENTMONTH - __PREVIOUSMONTH >= 0), __CURRENTMONTH - __PREVIOUSMONTH, __CURRENTMONTH))

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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.