Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have the measure below. At the moment if there are no records that meet the criteria, the field will display the word 'Blank'. How could i amend it so it displays a zero '0' please?
= CALCULATE(
COUNTA('Procurement_Main_Data'[SSRef]),
'Procurement_Main_Data'[Short Visit]= "Yes")
@amitchandak @tamerj1 @danextian @goncalogeraldes
Solved! Go to Solution.
Hi @spandy34
You can do the following:
Measure=
var _myVar= = CALCULATE(
COUNTA('Procurement_Main_Data'[SSRef]),
'Procurement_Main_Data'[Short Visit]= "Yes")
return
IF(ISBLANK(_myVar),0,_myVar)
Hello @spandy34 ,
You can simply add 0 at the end of the measure.
Please check below measure to achieve the solution:
= CALCULATE(
COUNTA('Procurement_Main_Data'[SSRef]),
'Procurement_Main_Data'[Short Visit]= "Yes") + 0
Kindly accept it as a solution if it helps.
Check if this works?
Count Short Visit =
VAR ShortVisitCount =
CALCULATE(
COUNTA('Procurement_Main_Data'[SSRef]),
'Procurement_Main_Data'[Short Visit] = "Yes"
)
RETURN
IF(ShortVisitCount <> 0, ShortVisitCount, 0)
Great thank you
Check if this works?
Count Short Visit =
VAR ShortVisitCount =
CALCULATE(
COUNTA('Procurement_Main_Data'[SSRef]),
'Procurement_Main_Data'[Short Visit] = "Yes"
)
RETURN
IF(ShortVisitCount <> 0, ShortVisitCount, 0)
THank you it works
Hello @spandy34 ,
You can simply add 0 at the end of the measure.
Please check below measure to achieve the solution:
= CALCULATE(
COUNTA('Procurement_Main_Data'[SSRef]),
'Procurement_Main_Data'[Short Visit]= "Yes") + 0
Kindly accept it as a solution if it helps.
Thank you it works!
Hi @spandy34
You can do the following:
Measure=
var _myVar= = CALCULATE(
COUNTA('Procurement_Main_Data'[SSRef]),
'Procurement_Main_Data'[Short Visit]= "Yes")
return
IF(ISBLANK(_myVar),0,_myVar)
Thank you it works
User | Count |
---|---|
131 | |
71 | |
70 | |
58 | |
54 |
User | Count |
---|---|
194 | |
95 | |
65 | |
62 | |
53 |