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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
lardo5150
Employee
Employee

Show Zero Count unless selected in a slicer

I currently have this setup.

I want to choose a date range

select an engineer

and it will show me the total number of critsits, normal, hot cases they took.

 

showzerocard.JPG

 

I have measure setup for each of the values from that column

 

For example, to get the count of "normal" 

CALCULATE(COUNT('Acceptance History'[CRITSIT])+0,ALLSELECTED('Acceptance History'[Engineer]),'Acceptance History'[CRITSIT]="Normal")

 

This works, but if I have no engineer elected, it still shows me the total number taken between all the engineers for that specific date range.

I want it to show zero UNTIL I select an engineer.

History'[Engineer]),'Acceptance History'[CRITSIT]="Normal")

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @lardo5150 ,

 

wrap something like this around your working measures:

IF(HASONEVALUE('<tablename>'[Engineer])
, [your measure]
, BLANK()
)

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User
TomMartens
Super User
Super User

Hey @lardo5150 ,

 

wrap something like this around your working measures:

IF(HASONEVALUE('<tablename>'[Engineer])
, [your measure]
, BLANK()
)

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Really close....

It puts the "BLANK" in there.

Is it possible to show a zero?

Hey @lardo5150 ,

 

just replace the formula BLANK() with 0

 

Hey @amitchandak , there is a tiny difference between ISFILTERED and HASONEVALUE, for this reason, I would not generally replace HASONEVALUE with ISFILTERED.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

@TomMartens 

Actually, It was open for sometime with me, and I did not realize that you have already given a solution. Thanks for the explanation.

I actually combined what he first gave me, with something I found in another post.

This worked for me.

IF(HASONEVALUE('<tablename>'[Engineer])
, [your measure]
, BLANK()
)

then combined it with this:

if(ISBLANK([Original Measure]),0,[Original Measure])

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.