Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Guys,
I am learning in Power BI, Would appreciate your help on below query, I have a tabe like this and I have to find average of these ID's(i.e average of count of ID's) for last 6 months,
Thank you!
| ID | DATE |
| 1 | 1/10/2021 |
| 2 | 1/11/2021 |
| 3 | 2/11/2021 |
| 4 | 3/11/2021 |
| 5 | 4/11/2021 |
| 6 | 1/12/2021 |
| 7 | 2/12/2021 |
| 8 | 1/01/2022 |
| 9 | 2/01/2022 |
| 10 | 3/02/2022 |
| 11 | 4/03/2022 |
| 12 | 5/03/2022 |
| 13 | 11/04/2022 |
| 14 | 12/04/2022 |
@Anonymous , Try measure like
Rolling 6 Sales =
var _max = maxx(allselcted(date),date[date]) // or today()
var _min = date(year(_max), month(_max)-6,1)
return
CALCULATE(distinctcount(Table[ID]),filter(date, date[date] <=_max && date[date] >=_min))
or
Rolling 6 = CALCULATE(distinctcount(Table[ID]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 19 | |
| 17 | |
| 11 |