Forum Discussion

wlknsnBI's avatar
wlknsnBI
Helper II
6 years ago
Solved

Months between two dates (+decimals)

Hi,   I'm looking to get the months between two dates, plotted onto table like below (using calendar table probably). What would be the measure to make that happen to include partial months (lookin...
  • v-diye-msft's avatar
    6 years ago

    Hi wlknsnBI 

     

    Please kindly check below results:

    Table = ADDCOLUMNS(CALENDAR(DATE(2019,01,01),DATE(2020,12,31)),"YearM",YEAR([Date])*100+MONTH([Date]))
    Measure = var y = MAX('Table'[YearM])
    return
    DIVIDE(COUNTROWS('Table'),CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[YearM] = y)))

     

    Pbix attached.