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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I have this table:
| RowId | Id | StartDate | MailDate | Trips |
| 1 | 1 | 2019-11-20 | 2020-11-20 | 4 |
| 2 | 1 | 2019-11-20 | 2020-12-10 | 1 |
| 3 | 1 | 2019-11-20 | 2022-12-10 | 3 |
| 4 | 2 | 2018-11-20 | 2021-01-01 | 6 |
| 5 | 2 | 2018-11-20 | 2021-02-02 | 7 |
| 6 | 3 | 2019-01-01 | 2020-01-01 | 2 |
| 7 | 3 | 2019-01-01 | 2022-05-05 | 2 |
| 8 | 3 | 2019-01-01 | 2022-06-09 | 3 |
| 9 | 4 | 2015-01-01 | 2019-01-01 | 2 |
What I need to do:
I need the SUM of Trips made after each year since each Ids StartDate.
The output needs to be this table, which would look like this for the above table:
| YearsPassedSinceStartDate (0-5 years is fixed interval) | Amount (this will be our calculated column) |
| 0 | 0 |
| 1 | 7 |
| 2 | 13 |
| 3 | 8 |
| 4 | 2 |
| 5 | 0 |
For example, for YearsPassedSinceStartDate with the value "1", we know that the amount is = 7.
- Why? Because RowId 1, 2 and 6's DateDiff between MailDate and StartDate is 1 year. And SUM of their trips is 4+1+2 = 7.
How do I produce the above table's calculated "Amount" column like this?
Solved! Go to Solution.
you can create a column
Column = int( DATEDIFF('Table'[StartDate],'Table'[MailDate],month)/12)
create a year table
and create a measure
Measure = sumx(FILTER('Table',max('Table (2)'[year])='Table'[Column]),'Table'[Trips])+0
pls see the attachment below
Proud to be a Super User!
you can create a column
Column = int( DATEDIFF('Table'[StartDate],'Table'[MailDate],month)/12)
create a year table
and create a measure
Measure = sumx(FILTER('Table',max('Table (2)'[year])='Table'[Column]),'Table'[Trips])+0
pls see the attachment below
Proud to be a Super User!
Vote for your favorite vizzies from the Power BI World Championship submissions!
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 |
|---|---|
| 56 | |
| 52 | |
| 45 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 108 | |
| 106 | |
| 39 | |
| 33 | |
| 25 |