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

blank on card visualization for Boolean

Hi,

 

I have "TA" column which is "True/False" data type. I am adding this in Card visualization to get count for only True and applying visula level filter like "TA" = True" getting values based on filter selection fine upto here.

if there no value for True getting blank how to make 0? and in my db there is no blanks only True and False statements.

 

Based on filter selection sometimes values shwoing in card and when condition is no met showing blanks.

 

Thanks,

Venkat

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

According to your description, you can follow my steps:

1. Create a calculated column:

 

Column = 
SWITCH(
    [TA],
    TRUE(),1,
    FALSE(),0)

 

2. Create a measure:

 

Count = 
var _count=CALCULATE(COUNT([Column]),'Table'[Column]=1)
return 
IF(_count=BLANK(),0,_count)

 

 

3. And place this measure on the card chart, you can get what you want, like this:

屏幕截图 2020-10-29 122833.png

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous ,

 

calculate(countrows(Table), filter(Table, Table[TA] =true()))+0

Anonymous
Not applicable

@amitchandak 

https://capgemini-my.sharepoint.com/:u:/p/venkata_paleru/EXDz3E-5UFxIvd4FuPX1w_cBm7qpQoRmQpnNxNK_Ln-...

Please find the pbix file. I am not getting solution with your calc.

 

Regards,

Venkat

 

Anonymous
Not applicable

@amitchandak 

if not able to access the pbix file then below is the user case.

Region is my clicer and TA is into Card Visual -bydefault when drag this field Count of TA and i want the result only "True" so Visula level filter applied. when i select PMG i will get count 1 and when select SKG showing "Blank" this should be replaced with 0

 

RegionTA
PMGTrue
SKGFalse
SKOFalse
PMOFalse
GATrue
GASTrue

 

Thanks,

Venky

Hi, @Anonymous 

According to your description, you can follow my steps:

1. Create a calculated column:

 

Column = 
SWITCH(
    [TA],
    TRUE(),1,
    FALSE(),0)

 

2. Create a measure:

 

Count = 
var _count=CALCULATE(COUNT([Column]),'Table'[Column]=1)
return 
IF(_count=BLANK(),0,_count)

 

 

3. And place this measure on the card chart, you can get what you want, like this:

屏幕截图 2020-10-29 122833.png

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@v-robertq-msft  Thanks so much its working as expected as per your logic..

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.