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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sridevi
Helper I
Helper I

Hide the data values or show blanks from Card visuals while not filtering data from slicer

Hi,

 

I need some help from you all. I need to hide my data from Card Visual chart in Power BI at initially in dashboard. I used some slicers for filters in my report. I want to show my card visual data while I am being selected some values from slicers. Please find the attachment for the reference. I want to show no. of units based on product release and ceiling type charts data labels either should be hide initially or should be shown balnk value. If I would apply any filter from product release and ceiling type then my data should be shown. As per below picture, it shows all units values even if I dont apply any filter.

 

card .jpg

Could you please kindly help me that how to resolve this issue in power bi.

 

Thanks in advance.

 

Thanks & Regards

Sridevi

9 REPLIES 9
Anonymous
Not applicable

Hello! I am currently using almost the same exact DAX code that was proposed in the solution in a tooltip right now seen here...

 

"Filter_Measure = if(and(hasonevalue(Building_Reports2[Year]),HASONEVALUE(Building_Reports2[Year])),sum(Building_Reports2[EUI]),0)"

 

I was wondering if there was any way to instead of using "blank" or "0" if I would be able to insert a brief message (i.e. "Please filter by ...")? Currently whenever I enter a string in this section the visual is popping up as blank when unfiltered. But when I use a zero the zero will pop up. Any tips, comments or suggestions are welcomed, thanks! 

 

Austin I 

Anonymous
Not applicable

Looks like I answered my own question. This method seems to work just fine with a card visual but the gauge visual that I was attempting to use did not allow it to work

v-yulgu-msft
Employee
Employee

Hi sridevi,

 

To solve the issue that the Card Visual shows the number format as wrongly(220,00 instead of 220), please control the data format in DAX query:

 

= IF(HASONEVALUE('KTOC DATA'[TYP_PRODUCT_RELEASE]);FORMAT(DISTINCTCOUNT('KTOC DATA'[ProductGUID]), “###.##”; ””)

 

If you have any question, please feel free to ask.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft,

 

I tried to implement the same as my own measurement.  Please see this below measurement.

 

No. of units for product release = IF(HASONEVALUE('KTOC DATA'[TYP_PRODUCT_RELEASE]);FORMAT(DISTINCTCOUNT('KTOC DATA'[ProductGUID]);"###");"")

 

But I got the below error.

 

error.jpg

 

It seems conversion error text to number.

 

My expected output would be that No.product units should be displayed as whole number ex: 2340 if I filtered something from  my slicer and If i dont apply filter then my output would be none(empty). I dont want to display as 0.

 

As of now I currently used below formula as displayed 0 without applying any format.

No. of units for product release = IF(HASONEVALUE('KTOC DATA'[TYP_PRODUCT_RELEASE]);DISTINCTCOUNT('KTOC DATA'[ProductGUID]);0)

 

Could you please help me how to resolve my error while applying format in my formula.

 

Thanks in advance.

 

Regards

Sridevi

ankitpatira
Community Champion
Community Champion

@sridevi Create measure in power bi desktop as below and then use that measure for KPI visual.

 

=IF( AND(HASONEVALUE('tableNAME'[slicerCOLUMN]),HASONEVALUE('tableNAME'[slicerCOLUMN])), SUM('tableNAME'[numerofunitsCOLUMN]), BLANK() )

Hi @ankitpatira,

h

Thanks a lot for your help. I am trying to implement the same for my requirement. I have one doubt. Is it possible to display as empty instead of showing BLANK value. I am trying to modify the formula as shown below. 

 

No. of units filter product release = IF(HASONEVALUE('KTOC DATA'[TYP_PRODUCT_RELEASE]);DISTINCTCOUNT('KTOC DATA'[ProductGUID]);BLANK())

 

Its working fine as expected but problem is its shown data as (Blank). My requirement is it should not be shown anything in data label. I want to show just empty chart with title without data(BLANK or 0 or whole data).

 

I am applying "" instead of BLANK() in syntax and  data is shown empty for without applying filter as per my requirement but it shows number format as wrongly(220,00 insead of 220) if I apply filter because it treated as data type as text because of "". I am not sure how can I convert my data type as whole number instead of text for this if conditon true.

 

Could you please help me how to resolve this issue if possible?

 

Thanks in advance.

 

Regards

Sridevi

 

 

@sridevi Use 0 instead of blank().

Hi @sridevi,

 

Use this instead of BLANK function for anything you want to display.

 

Measure = IF( AND(HASONEVALUE('tableNAME'[slicerCOLUMN]),HASONEVALUE('tableNAME'[slicerCOLUMN])), SUM('tableNAME'[numerofunitsCOLUMN]), "Select Account" )

 

Capture.PNG

 

Hope this answers your question.

 

Thanks,

 

Yousuf

 

Hi @ankitpatira,

 

Thank you for the suggestion. Yes I used 0 but our requirement is to display empty data without 0 or BLANK if I dont filter anything. I am trying to figure out this one.

 

Thanks

Sridevi 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.