Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Make two separate formatted texts by using SWITCH

Hello,

My measure is

 

Accept / Reject sign =
    SWITCH(TRUE(),
    VALUES('Chart'[Chart type]) = "Accept", "ACCEPT,           <- this needs to be font 16
    VALUES('Chart'[Chart type]) = "Reject", "REJECT"             <- this needs to be font 12
    )
 
Is it something I can achieve? 

3 Replies

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hello Anonymous ,

     

    what exactly do you want to do? Do you want to create a measure or a calculated column?

    In general VALUES returns a column with single values. So this approach would only work if only one value is returned.

     

    I would try something like this:

    Accept / Reject sign =
    SWITCH (
        MAX ( 'Chart'[Chart type] ),
        "Accept", "ACCEPT",
        "Reject", "REJECT"
    )
    

     

    You can also archive the same with the following approach:

    Accept / Reject sign = UPPER ( MAX ( 'Chart'[Chart type] ) )

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution โœ”๏ธ and give it a thumbs up ๐Ÿ‘

    Best regards
    Denis

    Blog: WhatTheFact.bi
    Follow me: twitter.com/DenSelimovic

    • Anonymous's avatar
      Anonymous
      Not applicable

      I'd like just to have a sign, if chart will be for accept, it will have a sign "Accept" above the chart, if Reject, then Reject, but I'd like to have different formats on these signs and avoid using bookmarks