Hi helpful people,
I have below measure counting a text field, I need to return 0 when field value is blank, Below is the measure I created.
=======
Solved! Go to Solution.
Try the following:
TSF Facility in Use =
VAR Total = CALCULATE(
COUNT('FACT-Data'[TEXT]),
KEEPFILTERS('FACT-Data'[TEXT] <> BLANK())
)
RETURN
IF(ISBLANK(Total), 0, Total)
Another option is to add 0 at the end the formula:
TSF Facility in Use = CALCULATE(
COUNT('FACT-Data'[TEXT]),
KEEPFILTERS('FACT-Data'[TEXT] <> BLANK())
) + 0
@amalrio , in the return you can add +0
RETURN
Total +0
Or
RETURN
if(isblank(Total),0,Total)
Proud to be a Super User!
Modify with ISNULL
TSF Facility in Use =
VAR Total = CALCULATE(
COUNT('FACT-Data'[TEXT]),
KEEPFILTERS('FACT-Data'[TEXT] <> BLANK())
)
RETURN
IF(OR(ISBLANK(Total),ISNULL(Total)), 0, Total)
Proud to be a Super User!
Try the following:
TSF Facility in Use =
VAR Total = CALCULATE(
COUNT('FACT-Data'[TEXT]),
KEEPFILTERS('FACT-Data'[TEXT] <> BLANK())
)
RETURN
IF(ISBLANK(Total), 0, Total)
Another option is to add 0 at the end the formula:
TSF Facility in Use = CALCULATE(
COUNT('FACT-Data'[TEXT]),
KEEPFILTERS('FACT-Data'[TEXT] <> BLANK())
) + 0
Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.
User | Count |
---|---|
435 | |
147 | |
120 | |
51 | |
49 |
User | Count |
---|---|
450 | |
132 | |
126 | |
81 | |
74 |