Hey Zain, could you upload a workbook to get a better understanding of your problem?
You can't apply an IF statement to the Measure Name pill (in fact you can't create a calculated field with it), therefore you would have to create a statement that addresses each measure. If i'm able to have a look at your workbook or to a mock up table that resembles it, I'll be able to provide you a much comprehensive answer
Diego is right - you can't change all of your measures at the same time if you have your datasource set up with 1 column for each measure. Sometimes it is better to restructure your datasource to enable certain things in tableau - for example if your dataset was survey questions and responses you could change it from
ResponseID Q1 Q2 Q3 1 1 0 1 2 0 1 0
ResponseID Question Response 1 Q1 1 1 Q2 0 1 Q3 1 2 Q1 0 2 Q2 1 2 Q3 0
The first structure is good for regression and modelling and certain types of calculations, whereas the second structure is quite strong for displaying and comparing questions against each other, and I've found it to be the best for survey question and response sets. It has the added benefit that you can change the 1's to Yes for every question at the same time.
There are many ways to make this change, tableau has this built in Pivot Data from Columns to Rows - Tableau, or you can use external tools such as Tableau prep, R or do it manually if your dataset is small.
You might also want to check out the alias functionality in tableau, it means you can change the 1's to Yes without having to create another field. - Create Aliases to Rename Members in the View - Tableau
1 of 1 people found this helpful
There's an easy way to accomplish this with custom number formatting.
Right click on "Measure Values" on your text mark and select Format. On the Pane tab in the formatting menu, under Default, click into "Numbers", then select Custom, and in the box that pops up enter this (including the commas):
This will change any positive numbers to "YES" (in this case, that will be all your 1 values). The second value between the two semi-colons is blank since you don't have any negative values. Then the last value sets any 0 values to "NO".
Here's how it looks in an example I mocked up. The "YES" values were all 1s, and the "NO" values were zeros.
You can check this out in the attached workbook too. Let me know if you have any questions.
Thank you! This is exactly what I needed
Welcome! Happy to help!