DAX - IF lookup value empty return column value

10,445

i think that you have created a relation between name.tableA and name.TableB. You can Create a calculated column on TABLEA using related(Type.TableB).

At this point if you have a relation between the table in new column on TableA you have some row blank and some row with the TYpe.TableB. If it's working change the column formula with

 =if(ISBLANK(related('TableB'[Type]));'tableA'[name];related('TableB'[Type]))

If there isn't a connection between table you should change related with Lookup.

Share:
10,445
Admin
Author by

Admin

Updated on June 14, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm using Power Pivot 2013, I have two table.

    (fact)Table A: Name and Value (dim) Table B: Name and Type

    When selecting pivottable, I want to show Type and Value but if Name.TableA can't be found in Name.TableB, instead of returning (blank) i want pivottable to return Name.TableA. I have tried VALUES() IF(VALUES) with no success.

    Thank you in advance.

  • GregGalloway
    GregGalloway about 8 years
    Is that DAX? The syntax doesn't look valid.
  • nicolò grando
    nicolò grando about 8 years
    it is an example of structure: =if(ISBLANK(related('TableB'[Type]));'tableA'[name];related(‌​'TableB'[Type]))
  • GregGalloway
    GregGalloway about 8 years
    but your code in your answer is different and had . not [] so please update your answer.