Forum Discussion

Saxon10's avatar
Saxon10
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

IF ISBLANK Return Blank

 

Hi,

 

I have a one table, that table contain multiple columns and count. I am trying to build final status based on the columns A:G.

 

ITEMABCDEFGREESULT
1232      ONE
12446     MULTIPLE
1251111   MULTIPLE
12611     MULTIPLE
12711     MULTIPLE
1281      ONE
1291      ONE
1301      ONE
1311      ONE
1321      ONE
1331      ONE
1341      ONE
1351      ONE
1361      ONE
13731     MULTIPLE
13831     MULTIPLE
139112    MULTIPLE
1402      ONE
1412      ONE
1421111   MULTIPLE
14331282  MULTIPLE
1442      ONE
14542211  MULTIPLE
146        
147        
148        

 

I am applying below mentioned DAX and it's working well but it will give a wrong result (Multiple) were columns are blanks (A:G) but desired result is blanks. Please refer 146,147 and 148.

 

Desired Result = IF(IF(ISBLANK(Table1[A]),0,1)+IF(ISBLANK(Table1[B]),0,1)+IF(ISBLANK(Table1[C]),0,1)+IF(ISBLANK(Table1[D]),0,1)+IF(ISBLANK(Table1[E]),0,1)+IF(ISBLANK(Table1[F]),0,1)+IF(ISBLANK(Table1[G]),0,1)=1,"One","Multiple")
  • Hi Saxon10 

     

    Download sample PBIX file

     

    Modify the DAX to this

    Result = 
    
    VAR _Count = IF(ISBLANK(Table1[A]),BLANK(),1)+IF(ISBLANK(Table1[B]),BLANK(),1)+IF(ISBLANK(Table1[C]),BLANK(),1)+IF(ISBLANK(Table1[D]),BLANK(),1)+IF(ISBLANK(Table1[E]),BLANK(),1)+IF(ISBLANK(Table1[F]),BLANK(),1)+IF(ISBLANK(Table1[G]),BLANK(),1)
    
    RETURN IF(_Count=1, "One", IF(ISBLANK(_Count), BLANK(), "Multiple"))

     

    Regards

    Phil

2 Replies

  • Hi Saxon10 

     

    Download sample PBIX file

     

    Modify the DAX to this

    Result = 
    
    VAR _Count = IF(ISBLANK(Table1[A]),BLANK(),1)+IF(ISBLANK(Table1[B]),BLANK(),1)+IF(ISBLANK(Table1[C]),BLANK(),1)+IF(ISBLANK(Table1[D]),BLANK(),1)+IF(ISBLANK(Table1[E]),BLANK(),1)+IF(ISBLANK(Table1[F]),BLANK(),1)+IF(ISBLANK(Table1[G]),BLANK(),1)
    
    RETURN IF(_Count=1, "One", IF(ISBLANK(_Count), BLANK(), "Multiple"))

     

    Regards

    Phil

    • Saxon10's avatar
      Saxon10
      Icon for Post Prodigy rankPost Prodigy

      Hi, 

       

      Thank you so much for your help and sorry for the late reply. Your solution is working very well.