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 everyone,
I am new to DAX and need your support in solving this problem.
I have two Excel files. One contains yearly target planned for different activities while the second contains monthly reports of reached. I want to count those activities that are lagging behind.
1.
2.
I tried to do smoething like this but I got lost in the middle:
var maxMonth = MAX('Reached'[month])
var target_table =SUMMARIZE('Target', 'Target'[Activity], "Monthly Target", CALCULATE ( DIVIDE(SUM( 'Target'[Target] ),12,0)))
var beneficiary_table = SUMMARIZE('Reached', 'Reached'[Activity], "Monthly Reached", CALCULATE ( DIVIDE(SUM( 'Reached'[Reached] ),maxMonth,0)))
What I want is a measure that distinct counts activities that are lagging behind ie. Monthly Target > Monthly Reached.
I would very much appreacite your help.
Thank you
Solved! Go to Solution.
@enoch99 You can create a calculated column in Target table
Reached =
SUMX (
FILTER ( Reached, [Activity] = EARLIEST ( Target[Activity] ) ),
[Reached]
)
If you need a measure, then try the below measure
Lagging =
VAR _target =
ADDCOLUMNS (
Target,
"@Reached",
SUMX (
FILTER ( Reached, [Activity] = EARLIER ( Target[Activity] ) ),
[Reached]
)
)
VAR _result =
COUNTX ( FILTER ( _target, [@Reached] < [Target] ), [Activity] )
RETURN
_result
@enoch99 based on above dataset, what is the expected result. Can you mention that as well?
@nandukrishnavsI want a table like this:
I think I can compare the Target and Reached columns after that to count the number of activities lagging behind.
Thanks
@enoch99 You can create a calculated column in Target table
Reached =
SUMX (
FILTER ( Reached, [Activity] = EARLIEST ( Target[Activity] ) ),
[Reached]
)
If you need a measure, then try the below measure
Lagging =
VAR _target =
ADDCOLUMNS (
Target,
"@Reached",
SUMX (
FILTER ( Reached, [Activity] = EARLIER ( Target[Activity] ) ),
[Reached]
)
)
VAR _result =
COUNTX ( FILTER ( _target, [@Reached] < [Target] ), [Activity] )
RETURN
_result
@nandukrishnavs Thank you for your quick response. This is what I was looking for.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |