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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Below is my table
ID
| Id | completion_date | result_date |
| 1 | 1/3/2017 | 3/3/2017 |
| 2 | 2/5/2017 | 8/5/2018 |
| 3 | 4/7/2017 | 6/8/2017 |
| 4 | 8/27/2017 | 10/26/2019 |
| 5 | 4/3/2018 | 9/8/2019 |
| 6 | 9/8/2018 | 8/7/2019 |
| 7 | 10/12/2019 | 11/24/2019 |
| 8 | 7/8/2019 | 9/20/2020 |
| 9 | 8/9/2019 | 11/26/2020 |
| 10 | 11/23/2019 | 12/31/2020 |
| 11 | 12/16/2019 | 3/4/2020 |
| 12 | 1/3/2020 | 2/5/2020 |
Below should be my result table.
| 1st day of each quarter of completion date | 1 year ahead of each quarter of completion date | Cumulative Count = count number of ids whose (completion_date < 1st day of each quarter of completion_date) && result_date < 1st day of each quarter of completion_date + 1 year) |
| 1/1/2017 | 1/1/2018 | 0 |
| 4/1/2017 | 4/1/2018 | 1 |
| 7/1/2017 | 7/1/2018 | 2 |
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
It is for creating a new table.
New Table =
VAR newtable =
ADDCOLUMNS (
Data,
"@quarter_start",
DATE ( YEAR ( Data[completion_date] ), ROUNDUP ( MONTH ( EOMONTH ( Data[completion_date], -1 ) + 1 ) / 3, 0 ) * 3 - 2, 1 ),
"@oneyearlater",
DATE ( YEAR ( Data[completion_date] ) + 1, ROUNDUP ( MONTH ( EOMONTH ( Data[completion_date], -1 ) + 1 ) / 3, 0 ) * 3 - 2, 1 )
)
VAR quarterstart_oneyearlater =
SUMMARIZE ( newtable, [@quarter_start], [@oneyearlater] )
VAR addcountcolumn =
ADDCOLUMNS (
quarterstart_oneyearlater,
"@count",
COUNTROWS (
FILTER (
Data,
Data[completion_date] < [@quarter_start]
&& Data[result_date] < [@oneyearlater]
)
) + 0
)
RETURN
addcountcolumn
Hi,
Please check the below picture and the attached pbix file.
It is for creating a new table.
New Table =
VAR newtable =
ADDCOLUMNS (
Data,
"@quarter_start",
DATE ( YEAR ( Data[completion_date] ), ROUNDUP ( MONTH ( EOMONTH ( Data[completion_date], -1 ) + 1 ) / 3, 0 ) * 3 - 2, 1 ),
"@oneyearlater",
DATE ( YEAR ( Data[completion_date] ) + 1, ROUNDUP ( MONTH ( EOMONTH ( Data[completion_date], -1 ) + 1 ) / 3, 0 ) * 3 - 2, 1 )
)
VAR quarterstart_oneyearlater =
SUMMARIZE ( newtable, [@quarter_start], [@oneyearlater] )
VAR addcountcolumn =
ADDCOLUMNS (
quarterstart_oneyearlater,
"@count",
COUNTROWS (
FILTER (
Data,
Data[completion_date] < [@quarter_start]
&& Data[result_date] < [@oneyearlater]
)
) + 0
)
RETURN
addcountcolumn
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 13 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 28 | |
| 19 | |
| 11 | |
| 10 |