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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello everyone!
I have a huge transactional table that shows me the Actuals vs. Target for machines, per row.
The structure is as follows:
DateTime | DateEnd | Machine | Actual | Target |
01.01.2021 00:05:00 | 01.01.2021 01:05:00 | 1 | 5 | 4 |
01.01.2021 01:05:00 | 01.01.2021 02:05:00 | 1 | 5 | 4 |
01.01.2021 02:05:00 | 01.01.2021 05:05:00 | 1 | ||
01.01.2021 05:05:00 | 01.01.2021 06:00:00 | 1 | 4 |
As you can see, there are three cases to distinguish here:
Now I want to calculate the average for the column "Targets".
The second case - no actuals/targets - should not be included.
In the third case - only actuals - the target should be equal to the actuals.
Unfortunately, the following approach does not give me a correct value for targets:
Target =
VAR _Check = IF(ISBLANK(AVERAGE(data[target])),[Actual],AVERAGE(data[target]))
RETURN
_Check
Hi @joshua1990
Try this.
Target =
CALCULATE (
AVERAGEX ( data, IF ( ISBLANK ( data[target] ), data[actual], data[target] ) ),
data[target] <> BLANK (),
data[actual] <> BLANK ()
)
If it is too slow we'll try another approach
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |