Forum Discussion

Seanan's avatar
Seanan
Icon for Solution Supplier rankSolution Supplier
4 years ago

Blanks in matrix won't replace

Hi guys, so I have a matrix where I am using UNICHAR's to represent answers that are either correct, incorrect or not attempted.

 

I am having a tough time trying to replace the blanks in my matrix though. I have tried the following code:

IF(ISBLANK([my dax column]),0,[my dax column])

and had no luck.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The code I am using for the values is as follows:

AnswerGraphic = 
SWITCH(TRUE(),
    'ItemCompleteSplitLang'[AwardedMark] >= 1&&ItemCompleteSplitLang[Attempted]>0,UNICHAR(9989),
    'ItemCompleteSplitLang'[AwardedMark] < 1&&ItemCompleteSplitLang[Attempted]>0,UNICHAR(10060), 'ItemCompleteSplitLang'[Attempted] <= 0, UNICHAR(128992))

 

Any help would be appreciated thanks.

8 Replies

  • Hi Seanan ,

    Is [my dax column] supposed to be a text? Have you tried using "0" instead of 0?

    • Seanan's avatar
      Seanan
      Icon for Solution Supplier rankSolution Supplier

      Hi danextian 

       

      Sorry I should have been clearer.

       

      The code I've tried is:

       

      ReplaceBlanks = IF(ISBLANK('ItemCompleteSplitLang'[AnswerGraphic]),"0",'ItemCompleteSplitLang'[AnswerGraphic])

       

      and sadly this did not replace the blanks.

      • danextian's avatar
        danextian
        Icon for Super User rankSuper User

        Hi Seanan ,

        How about adding another argument to your SWITCH formula? Try using this one instead:

        AnswerGraphic =
        SWITCH (
            TRUE (),
            'ItemCompleteSplitLang'[AwardedMark] >= 1
                && ItemCompleteSplitLang[Attempted] > 0, UNICHAR ( 9989 ),
            'ItemCompleteSplitLang'[AwardedMark] < 1
                && ItemCompleteSplitLang[Attempted] > 0, UNICHAR ( 10060 ),
            'ItemCompleteSplitLang'[Attempted] <= 0, UNICHAR ( 128992 ),
            "0" // return "0" if the other criteria are not met
        )

         

  • By the way, what does this show in data view? Is it showing "0" or blank?

    ReplaceBlanks = IF(ISBLANK('ItemCompleteSplitLang'[AnswerGraphic]),"0",'ItemCompleteSplitLang'[AnswerGraphic])

     

    • Seanan's avatar
      Seanan
      Icon for Solution Supplier rankSolution Supplier

       

       

       

      This is all I see, so no 0's in sight

      • danextian's avatar
        danextian
        Icon for Super User rankSuper User

        What I meant was, if you go to the data view, not on a visual, does ReplaceBlanks calculated column show "0"?