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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Column filter

hi, 

a basic quick question, 

if I have a column  A , and column A returns either 'b' and 'c', but I want to show them both on a pie chart, 

how do I go about it?

I have applied 

bA = (tablename[A] ), 'b'

cA = (tablename[A] ), 'c'

where am I wrong?

2 ACCEPTED SOLUTIONS

@Anonymous "Flag" is an calculated column name (you can name it as you like) which will have either Pass or Failed values based on values present in another field i.e. ColumnA as mentioned above. You need to use this new calculated column i.e. "Flag" in your pie-chart. Hope this helps !!




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

Anonymous
Not applicable

Thanks, 

for some reasons I still get syntax error on the logic but I belive this is what I need, 

 

View solution in original post

6 REPLIES 6
v-yuta-msft
Community Support
Community Support

Hi atrinhatra,

 

A pie chart at least needs two columns, value column and legend column, if columnA is a category column, put columnA to legend field and another column to value field.

Capture.PNG 

 

Regards,

Jimmy Tao

Anonymous
Not applicable

You may have missundrestood my question. 

columnA returns 'yes' or 'no'

but I want to show if columnA = 'yes' show 'pass'

if columnA = 'no' show 'failed' 

another word , I am asking the DAX syntax of above 

@Anonymous Is this what you are looking for ? Try this as a new column

 

Flag = SWITCH(TRUE(),Table[ColumnA]="Yes","Pass",Table[ColumnA]="No","Failed")




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

Thanks, Yes thats what I am after, however what does FLag represents? the code gives an error " THE syntax for 'FLag' in incorrect, (DAX(..........

 

@Anonymous "Flag" is an calculated column name (you can name it as you like) which will have either Pass or Failed values based on values present in another field i.e. ColumnA as mentioned above. You need to use this new calculated column i.e. "Flag" in your pie-chart. Hope this helps !!




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

Thanks, 

for some reasons I still get syntax error on the logic but I belive this is what I need, 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.