Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Hi,
I have a table that shows number of worked hours for the company as a total. The numbers are updated manually every month for the previous month (e.g. now in october, the numbers for september were filled in to the excel sheet).
I want to create a column that shows "1" if the month is within the last 12 months from todays month, and "0" if not (see illustration below).
I have created YearMonth and MonthIndex columns to help me with this, but I am not able to complete the formula to create the "last 12 months" column. Can anyone help me out?
Solved! Go to Solution.
@Anonymous
Try a new column like
new column =
var _date = today()
var _max = format(today(), "YYYYMM")
var _min = format(date(year(_date), month(_date)-12,day(_date)), "YYYYMM")
return
if([yearmonth]>=_min && [yearmonth] <= _max ,1,0)
@Anonymous
Try a new column like
new column =
var _date = today()
var _max = format(today(), "YYYYMM")
var _min = format(date(year(_date), month(_date)-12,day(_date)), "YYYYMM")
return
if([yearmonth]>=_min && [yearmonth] <= _max ,1,0)
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 65 | |
| 64 | |
| 49 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 119 | |
| 117 | |
| 38 | |
| 36 | |
| 29 |