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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

ZERO for measure returning no values

Dear Community

I have two measures and if the one does not return a value and the other one does, then the one that should be blank must return a ZERO/hyphen.

 

The problem is that my measure returns ZERO/hyphen for ALL values in the relevant dimension column in my visual, and not just the dimensions that have values.

 

Result required : I would like to filter out the dimension values that don't have a result in any of the measures in the visual. eg below, the red blocks should not be in the visual.

How can I amend my measure to achieve this? HASONEVALUE? ISINSCOPE? Or should I use a visual filter? Other solutions?

I would also like a solution, if possible, that does not require you to specify specific dimensions. Any dimension should be able to work with the solution.

 

nikilouwgmail_0-1701159955687.png

 

Measure 1 and 2 - without ISBLANK
VAR _result =
CALCULATE (
[Measure],
FILTER (
'DIM_Types',
'DIM_Types'[Type] = "Refund"
)
)

RETURN
IF ( ISBLANK(_result), 0, _result )

 

Measure 1 - with ISBLANK
VAR _result =
CALCULATE (
[Measure],
FILTER (
'DIM_Types',
'DIM_Types'[Type] = "Refund"
)
)

RETURN
IF ( ISBLANK(_result), 0, _result )

2 REPLIES 2
lbendlin
Super User
Super User

 if the one does not return a value and the other one does, then the one that should be blank must return a ZERO/hyphen.

That is a design red flag.  Using a hyphen may be common practice in financial reports but it is anathema to Power BI.  Leave the spot blank.

 

(You will see hacks that say   measure = 0+calculation   but these are only masking your problem, they are not solving it)

v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.