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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.