The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
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!
Solved! Go to Solution.
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~
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~
thank you so much, it works!!
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
27 | |
18 | |
13 | |
9 | |
5 |