MDX- How to custom Format_String in a calculated measure

  • Hi to all of you.

    I read it is possibile customize FORMAT_STRING of a calculated measure

    I use SSAS 2008 R2 and inside my project's cube , i tried this expression:

    CREATE MEMBER CURRENTCUBE.[Measures].[Indicatore X]

    AS [Measures].[NumeroProdotti],

    FORMAT_STRING =

    IIF( [Measures].[NumeroProdotti] = 1

    ,"'X'"

    ,"" ),

    VISIBLE = 1 , DISPLAY_FOLDER = 'Conteggio Numero Prodotti';

    [Measures].[NumeroProdotti] is a numeric memeber.

    I need to convert this numeric value into a string as 'X' if this measure = 1

    Otherwise i need to put a null string.

    No errors received but this expression does not work as i'd like.

    I see the same value 1 and not 'X' ...

    Any suggestions ???

    Is it possibile what i need ???

    Regards to all of you.

    Have a good Chrstmas.

    Mauro.

  • FORMAT_STRING is for setting the format (for example currency), not this sort of display behaviour.

    In order to get what you want your code should be something like:

    CREATE MEMBER CURRENTCUBE.[Measures].[Indicatore X]

    AS IIF( [Measures].[NumeroProdotti] = 1

    ,"'X'"

    ,"" ),

    VISIBLE = 1 , DISPLAY_FOLDER = 'Conteggio Numero Prodotti'


    I'm on LinkedIn

  • Thanks for your kind answer.

    I will try as soon as possible...

    I am thinking it is simpler than i'd imagine ..:-)

    i WISH FOR YOU and all people of this useful blog,,,HAPPY CHRSTMAS to you and your families.

    THANKS again.

  • maretix (12/24/2014)


    Thanks for your kind answer.

    I will try as soon as possible...

    I am thinking it is simpler than i'd imagine ..:-)

    i WISH FOR YOU and all people of this useful blog,,,HAPPY CHRSTMAS to you and your families.

    THANKS again.

    Same to you - it's Christmas so stop worrying about MDX and have some fun 😀


    I'm on LinkedIn

  • I confirm that your solution works,

    So..many thanks !!!

    It is simpler i could imagine...

    I am not Young but not so good in MDX ...

    Regards !!!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply