Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
joshua1990
Post Prodigy
Post Prodigy

Average Measure with Blanks cells

Hello everyone!

I have a huge transactional table that shows me the Actuals vs. Target for machines, per row.
The structure is as follows:

DateTimeDateEndMachineActualTarget
01.01.2021 00:05:0001.01.2021 01:05:00154
01.01.2021 01:05:0001.01.2021 02:05:00154
01.01.2021 02:05:0001.01.2021 05:05:001  
01.01.2021 05:05:0001.01.2021 06:00:0014 

 

As you can see, there are three cases to distinguish here:

  • Case 1: All cells are felt.
    2nd case: No Actuals or Targets
    3rd case: Only actuals.

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

 

 

1 REPLY 1
AlB
Community Champion
Community Champion

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

 

SU18_powerbi_badge

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.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.