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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
moloyus
New Member

How to: if logic in Filters of clustered column chart visualization or pie chart visualization

Hello,

I am new to Power BI. I have a table (Contact) that has 278 rows with blank AccountIDs for some contacts.

moloyus_0-1617286304578.png

I wanted to create a "Clustered Column Chart / Pie chart" showing  "Contacts without AccountID vis-à-vis". I learnt to create a "Custom Column" and add appropriate values with this simple logic using DAX (

IsAccountIDBlank = if([AccountID]="","No_Account_ID","Contact_Has_AccountID")  img below)
 
moloyus_1-1617286732653.png

 

and create a graph based on the new column 

moloyus_2-1617287086512.png

 

 

How can I achieve the same results with the graph's filter? I don't want to create any additional column or DAX logic for the data that I already have( I can see blank vs non-blank accountID). I want to use the "Filter" in the "Clustered Column Chart" and incorporate "If Logic" in the filter. I can't seem to do it. I just can't seem to get a good grasp over these filters for all those visualizations objects. I want to learn/know how can I manipulate filters to add if logic so that I can show the same results as above without adding new columns?

 

Any help would be much appreciated. 

Thanks

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @moloyus ,

 

If so, it is suggested to copy the AccountID column as a calculated column and then use the filter pane like so:

 

1. Create a calculated column to copy the AccountID column.

AccountID - Copied = [AccountID]

 

2. Put the AccountID column and AccountID - Copied column into Values field of the Clustered column chart. and right click them to change the name to "AccountID - Blank", "AccountID - Not Blank".

 

3. Go to "Filters on this visual" and filter the vlaues as "Blank" or others.

 

 

Best Regards,

Icey

 

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

4 REPLIES 4
moloyus
New Member

Thanks and much appreciated for your quick reply. Just have one quick question though, are you saying that the "Filter Pane" of "Clustered column chart" can't help me doing the "Group BY" based on "AccountID=Blank " and(or) "AccountID Not Blank"? 

Issues with my users are they are non-technical. It is easier for them to use "Filter Pane of visualization " as drag-drop activities. They will not go for DAX (or any code-related complexities). If I can't hand them over to do their own reports, it defeats the purpose for us to use Power BI.

But I must acknowledge and thank you for your quick response.

Icey
Community Support
Community Support

Hi @moloyus ,

 

If so, it is suggested to copy the AccountID column as a calculated column and then use the filter pane like so:

 

1. Create a calculated column to copy the AccountID column.

AccountID - Copied = [AccountID]

 

2. Put the AccountID column and AccountID - Copied column into Values field of the Clustered column chart. and right click them to change the name to "AccountID - Blank", "AccountID - Not Blank".

 

3. Go to "Filters on this visual" and filter the vlaues as "Blank" or others.

 

 

Best Regards,

Icey

 

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

Thanks, Icey. Much appreciated. Worked like a charm.

amitchandak
Super User
Super User

@moloyus , Based on what I got.

 

You can two-measure if you do not want the additional column. that you use in bar and pie. without a column grouping will not happen

 

No_Account_ID = countrows(filter(Table, Table[AccountID] ="")) //or isblank(Table[AccountID])

 

Contact_Has_AccountID = countrows(filter(Table, Table[AccountID] <> ""))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors