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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Nursen
New Member

How to rename the legend while using an SQL Server Database

Hi there,

 

I am using an online SQL Server Database in PowerBI for my dashboard. (So the buttons "New Column" or "New Table" are inactive, and can't be used.)

I have a pie chart using the value from one of the tables in the SQL, and the data for this column is either true or false.

However in my dashboard, "true" or "false" means nothing for the viewers. I'd like to rename these as "Done" and "Not done".

 

I used the following measure, but when I used it on my pie chart, I could not add this to the "Legend" part. I have no idea why. 

 

State =
IF (
    'Table1'[Status] = TRUE,
    "Done",
    "Not done"
)
 
Any idea how I can rename the values of my piechart?
1 ACCEPTED SOLUTION
Joe_Barry
Solution Sage
Solution Sage

Hi @Nursen 

 

It seems that you are using a Direct Query connection to the SQL Server, is Using the Import an option? This will open all features within Power BI.

Otherwise adapt your select statement in SQL

 

SELECT 
CASE WHEN [Status] = TRUE THEN 'Done' ELSE 'Not Done' END as "Status"
FROM 
Table1

 

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




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

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn


Let's connect on LinkedIn


View solution in original post

1 REPLY 1
Joe_Barry
Solution Sage
Solution Sage

Hi @Nursen 

 

It seems that you are using a Direct Query connection to the SQL Server, is Using the Import an option? This will open all features within Power BI.

Otherwise adapt your select statement in SQL

 

SELECT 
CASE WHEN [Status] = TRUE THEN 'Done' ELSE 'Not Done' END as "Status"
FROM 
Table1

 

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




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

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn


Let's connect on LinkedIn


Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.