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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.