change true false certain

Public Schedule Face-to-Face & Virtual Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Power BI training and help » Change True, false to certain text

Change True, false to certain text

resolvedResolved · Medium Priority · Version 365

Change True, false to certain text

Is it possible to change True and False text in a visual to e.g. On Target, Within Target

RE: Change True, false to certain text

Hi Natalie,

Thankyou for you question to the forum.

I assume you have a list of TrueS and FalseS in a field relating to whether or not a target is met. If so, let's say this field heading is called 'Target'. In Power BI desktop, a visual such as a pie chart, will show the distribution of Trues and Falses which you want to change to On Target and Within Target. To achieve this, do the following:

1. Go to the datasheet containing the 'Target' field (via the Data view icon)

2. On the ribbon select 'New Column'

3. In the formula bar, type:

Target_Status = IF([Target]=TRUE(),"On Target","Within Target")

4. In the 'Report view' replace 'Target' with 'Target Status'

I hope this solves your problem. Please let me know if it has or if you require more support

Kind regards
Martin Sutherland
IT Trainer

RE: Change True, false to certain text

Thanks Martin, I have tried this and I received the following error - DAX comparison operations do not support comparing values of type Text with values f type True/False. Consider using the VALUE or FORMAT function to convert one of the values.

In the data table there is True, False and Still open in the field. I would like True displayed as Within Target, False as Outside of Target and Still Open as Still Open.

RE: Change True, false to certain text

Hi Natalie,

Thankyou for your further question.

This new information slightly changes things. As you say, there are 3 variables: true, false and still open. I assumed that there were only 2 variables (true, false) which normally would be formatted as Boolean TRUE/FALSE. Provided the field for this list is formatted as text, then you can still use an IF statement but it would need to be a nested IF. First of all you need to check the formatting:

1. In the Data view, select the field heading and check the list is positioned to the left not right and that the format is displayed as text (top left of the ribbon)

2. On the ribbon select 'New Column'

3. Type Target_Status = IF([Target]="true","Within Target", IF([Target]="false","Outside of Target","Still Open"))

Hopefully this should work

Kind regards
Martin
IT Trainer

RE: Change True, false to certain text

Thank you so much this has worked.

 

Training courses

 

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Power BI tip:

Report and Visualization Shortcuts

Ctrl + Shift + P: Enter or exit Presentation mode.
Ctrl + Shift + V: Toggle between different visualization types.
Ctrl + G: Group selected visuals.
Ctrl + Shift + H: Hide or unhide selected visuals.
Ctrl + Shift + L: Lock or unlock selected visuals.

View all Power BI hints and tips


Server loaded in 0.07 secs.