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!
Hello all
I have two tables one for tasks and the second for projects. Each project has many tasks. The tasks table shown below
it has fields as id code, project id, start date and finish date.
The second table is a simple one having project id and project name
It is important to note that the connection between the tasks is the task code as the ids are not the same between different project
I have created two slicers for users to select the current project and the baseline project. Then created a set of measures to calculate the start and finish dates based on the selected values in both slicers.
Now what I am trying to achieve is to count the number of activities where the variance is less than 0.
I tried creating a virtual table that will have the start date from the baseline and the start date from the current forcast and then used COUNTX with filter. Unfortunatley this did not work as it returned the total count of activites.
cnt =
var comb =
ADDCOLUMNS(TASK,
"task_code", CALCULATE(DISTINCT(TASK[task code]), FILTER(TASK, TASK[proj] = LASTNONBLANK('Current'[proj id],1))) ,
"blStart", CALCULATE(Min(TASK[Start]), filter(TASK, TASK[proj] = LASTNONBLANK(Baselines[proj id],1))),
"curStart", CALCULATE(min(TASK[Start]), FILTER(TASK, TASK[proj] = LASTNONBLANK('Current'[proj id],1)))
)
RETURN
COUNTX(Filter(comb, ([blStart] - [curStart])*1.0 < 0 ), [task code])
I appreciate if you could help in this issue.
The link to pbix and data file is here
Many thanks
Solved! Go to Solution.
This is a super elegant solution. Thank you!
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 |
|---|---|
| 64 | |
| 56 | |
| 43 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 108 | |
| 44 | |
| 32 | |
| 24 |