98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Power BI training and help » Change True, false to certain text
Change True, false to certain text
Resolved · Medium Priority · Version 365
Natalie has attended:
Power BI Modelling, Visualisation and Publishing course
Excel Forecasting and Data Analysis course
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
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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Power BI tip:Report and Visualization ShortcutsCtrl + Shift + P: Enter or exit Presentation mode. |