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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
sbolton1855
Frequent Visitor

Count the difference per Month

I am trying to count the number of times in a month a serial number is rebooting.  So from the start date that is the number w ewill start with 10, now at the end of the month the reboots has increased by 10 in Jan so my measure or field would need to calculate and show me 10.

 

SN     Date     reboots

abc   1/1          10

abc    1/3          15 

abc   1/21         20

1 ACCEPTED SOLUTION

hi @sbolton1855 

try this:

MonthlyReboots =
VAR CurrentSN = TableName[SN]
VAR CurrentMonth = MONTH(TableName[Date])
VAR Table1 =
FILTER(
        TableName,
        TableName[SN] = CurrentSN
            &&MONTH(TableName[Date]) = CurrentMonth
)
VAR StartReboot =
MINX( Table1, TableName[reboots] )
VAR EndReboot =
MAXX( Table1, TableName[reboots] )
RETURN
EndReboot - StartReboot
 
i double checked and it worked like this:

 

FreemanZ_0-1669858339054.png

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

@sbolton1855 

try to add a column with such code:
 
MonthlyReboots=
VAR CurrentSN = TableName[SN]
VAR CurrentMonth = MONTH(TableName[Date])
VAR Table1 =
FILTER(
        TableName, 
        TableName[SN] = CurrentSN,
        MONTH(TableName[Date]) = CurrentMonth
  )
VAR StartReboot =
MINX( Table1, TableName[reboots] )
VAR EndReboot =
MAXX( Table1, TableName[reboots] )
RETRUN EndReboot - StartReboot

For November I would expect to have 32, my cycle count is the reboots.  I didnt get any syntax errors tho and I also selected Dont sum.

 

 

Reboots = var CurrentSN = battery[serialnumber] 
var CurrentMonth = MONTH(battery[month]) 
var Table1 = FILTER(battery,abattery[serialnumber]=CurrentMonth) 
var StartReboot = MINX(battery,ah_battery[cyclecount]) 
var EndReboot = MAXX(battery,battery[cyclecount]) 
RETURN EndReboot-StartReboot

 

StartReboot is zero and EndREboot is 65535

 

 

sbolton1855_0-1669846762685.png

 

 

hi @sbolton1855 

try this:

MonthlyReboots =
VAR CurrentSN = TableName[SN]
VAR CurrentMonth = MONTH(TableName[Date])
VAR Table1 =
FILTER(
        TableName,
        TableName[SN] = CurrentSN
            &&MONTH(TableName[Date]) = CurrentMonth
)
VAR StartReboot =
MINX( Table1, TableName[reboots] )
VAR EndReboot =
MAXX( Table1, TableName[reboots] )
RETURN
EndReboot - StartReboot
 
i double checked and it worked like this:

 

FreemanZ_0-1669858339054.png

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.