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
Anonymous
Not applicable

Filtering Data in a card (text message)

Good morning,

I have created a card that shows the number of vehicles that are older than 10 years.

The vehicles are divided in 3 groups: A, B and C.

I have another dashboard that shows other data of A,B and C.

When i select in the dashboard for example A, in the card it shows a 1 ( there is only 1 vehicle of group A in the data with age>10).

if i select in the dashboard group B, instead of showing a 0 ( because there is no vehicle in group B with age>10), the card shows a text message with "In blank".

I dont know if there is a way of showing 0 instead of the message.

Thank you

 

 
 
2 ACCEPTED SOLUTIONS

Hi, @Anonymous you have to create a measure and put in the formula as mentioned:
NrOfVehicles_measure=IF(ISBLANK([Number of vehicles with more than 10 years]),0,[Number of vehicles with more than 10 years])

or

NrOfVehicles_measure=COALESCE([Number of vehicles with more than 10 years],0)

and then put the measure in your card visual.

 

--

 

 

View solution in original post

v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can add +0 following the formula as below.

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[age]>=10))+0

Capture.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

7 REPLIES 7
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can add +0 following the formula as below.

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[age]>=10))+0

Capture.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Thank you this work!!

But i have the same problem with the following field5.png

i have defined the following card:

6.png

 

i defined a new messure as you told me but with YES, and a error message is shown saying that is not correct

7.png

Thank you

pceglie
Resolver I
Resolver I

Hi @Anonymous, you can check the value with
IF(ISBLANK(myvalue),0,myvalue) function
or with 
COALESCE(myvalue,0) function

Hope it will help you

--

amitchandak
Super User
Super User

@Anonymous 

Create your formula with + 0

 

Measure = calculation(...) +0

 

And try

AilleryO
Memorable Member
Memorable Member

Hi @Anonymous ,

 

You actually have many solutions :

1/ Using a format on your data

2/ Using IF() function and ISBLANK() function to test and replace by the required value

IF(ISBLANK(Yourdata);0;YourData)

But quite sure you could find other ways...

Have a nice day

Anonymous
Not applicable

Thank you for answering.

I dont know where to put the "If is blank" form.

The way i have made the card to show how many vehicles have age>10 is by using the "Count" option and then in the "Filters" tab specifying to show only the ones that are bigger than 10

4.png

Hi, @Anonymous you have to create a measure and put in the formula as mentioned:
NrOfVehicles_measure=IF(ISBLANK([Number of vehicles with more than 10 years]),0,[Number of vehicles with more than 10 years])

or

NrOfVehicles_measure=COALESCE([Number of vehicles with more than 10 years],0)

and then put the measure in your card visual.

 

--

 

 

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.