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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

delete values of a measure when a value of an other measure is blank

Hello, I wrote this measure to calculate sales on square meters

Sold/Sqm = Sold/SqMeters

but when I try to average the total of this measure by Store, he gets the SqMeters total wrong because he returns the SqMeters value even when the Sold value related to a Store, is empty.

userpien_0-1719563761011.png


Store is a column
Sold is a measure
SqMeters is a column
Sold/SqM is a measure

Red is the wrong total, and green is the right onw that i want because doesn't count FOOD store that has empty sold.

How do I change the measure so that it only counts the Solds present related to Store?

I also wrote
Sold/Sqm =
VAR _soldsq = Sold/SqMeters
RETURN
IF([Sold],_soldsq)
or
Sold/Sqm =
VAR _soldsq = Sold/SqMeters
RETURN
IF([Sold]>1,_soldsq)

or
Sold/Sqm =
VAR _soldsq = Sold/SqMeters
RETURN
IF(NOT(ISBLANK([Sold]>1)),_soldsq)

but it doesn't work

Thank you!

1 ACCEPTED SOLUTION
xifeng_L
Super User
Super User

Hi @Anonymous 

 

You can try below measure.

 

Sold/Sqm =
CALCULATE (
    Sold / SqMeters,
    FILTER ( VALUES ( Table[Store] ), [Sold] <> BLANK () )
)

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

View solution in original post

2 REPLIES 2
xifeng_L
Super User
Super User

Hi @Anonymous 

 

You can try below measure.

 

Sold/Sqm =
CALCULATE (
    Sold / SqMeters,
    FILTER ( VALUES ( Table[Store] ), [Sold] <> BLANK () )
)

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

Anonymous
Not applicable

thank you so much, it works!!

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.