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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Jrich18
Frequent Visitor

Dealing with blank data - creating measures

Hi,

 

Im realatively new to power BI, im using a flat file to report on price movements of commodities.

not all commodities have price data for each month.

 

My data table looks like this:

CommodityDatePrice
101-Jan1
102-Jan2
103-Jan3
201-Jan1
203-Jan2
204-Jan3
301-Jan1
305-Jan2

 

I want to create measures to calculate things such as averag price and % change. However the average price takes into account the blanks and brings the average down. how can i get around this? ive tried the following which doesnt work in ignoring the blanks:

CALCULATE(AVERAGE('Weekly Master'[Price]), 'Weekly Master'[Price]<>0||'Weekly Master'[Price]<>BLANK())
 
Thanks!
1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @Jrich18 

AVERAGE already ignores the blanks (not the zeros, of course). Use an AND instead of an OR:

 

CALCULATE(AVERAGE('Weekly Master'[Price]), 'Weekly Master'[Price]<>0  &&  'Weekly Master'[Price]<>BLANK())

 

 

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.

 

 

View solution in original post

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @Jrich18 

AVERAGE already ignores the blanks (not the zeros, of course). Use an AND instead of an OR:

 

CALCULATE(AVERAGE('Weekly Master'[Price]), 'Weekly Master'[Price]<>0  &&  'Weekly Master'[Price]<>BLANK())

 

 

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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