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
Hi, I am trying to create a measure that would count the number of intervals that were skipped on a project. A project can have x amount of sub projects. Each sub project has x amounts of planned intervals. Once there is completed data, it is submitted to another table. If an interval is not completed, no data is submitted. Here is an example of the data:
Planned data
| ProjectIDID | SubProjectID | IntervalNumber | ProgToBeTreated |
| 1112 | 2961 | 7 | Y |
| 1112 | 2961 | 6 | Y |
| 1112 | 2961 | 5 | Y |
| 1112 | 2961 | 4 | Y |
| 1112 | 2961 | 3 | Y |
| 1112 | 2961 | 2 | Y |
| 1112 | 2961 | 1 | Y |
| 1112 | 2960 | 5 | Y |
| 1112 | 2960 | 4 | Y |
| 1112 | 2960 | 3 | Y |
| 1112 | 2960 | 2 | Y |
| 1112 | 2960 | 1 | Y |
| 1112 | 2959 | 4 | Y |
| 1112 | 2959 | 3 | Y |
| 1112 | 2959 | 2 | Y |
| 1112 | 2959 | 1 | Y |
active/completed data
| ProjectIDID | SubProjectID | IntervalNumber |
| 1112 | 2961 | 4 |
| 1112 | 2961 | 2 |
| 1112 | 2961 | 1 |
| 1112 | 2960 | 3 |
| 1112 | 2960 | 2 |
| 1112 | 2960 | 1 |
| 1112 | 2959 | 4 |
| 1112 | 2959 | 2 |
| 1112 | 2959 | 1 |
2961 and 2959 have skipped interval 3 and moved directly onto 4. I am trying to create a measure that would record those 2 skipped intervals without data. The following formula works when the job is completed, but I would like to have an active count.
Any help is appreciated
Here is one measure expression that should work.
SkippedIntervals =
VAR vSummary =
ADDCOLUMNS (
SUMMARIZE ( Projects, Projects[ProjectIDID], Projects[SubProjectID] ),
"@Max", CALCULATE ( MAX ( Projects[IntervalNumber] ) ),
"@Intervals", CALCULATE ( COUNTROWS ( Projects ) )
)
RETURN
SUMX ( vSummary, [@Max] - [@Intervals] )
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
With some additional testing, the solution I put forward is incorrect. Looking for additional help :C
Would this be an acceptable solution? I don't have the dataset to 100% test this yet to see if it would be dynamic for each SubProjectID. Just building off your solution here:
Thanks so much for quick response! This solves about 90% solutions. I have one quick question that I hope is an easy answer. In the PlannedData, there is a ProgToBeTreated column. Sometimes it is planned to skip treating an interval. How would I go about subtracting the intervals that were planned to be skipped, once @ max has reached/past those intervals? Thanks!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |