Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Replace blank with Not assigned

I'm having blank values  caused by relationship and with no matched record. But I want to replace it with "Not assigned" text

  • Hi Anonymous ,
    Thanks for using Microsoft Fabric Community Forum.
    Try using the below DAX to create a new column.

    Acct Assignment Order - Text (Updated) =
    VAR AcctAssignment =
        LOOKUPVALUE(
            'Table2'[Acct Assignment Order - Text],
            'Table2'[Order Key], 'Table1'[Order Key]
        )
    RETURN
    IF(
        ISBLANK(AcctAssignment) || AcctAssignment = "",
        "Not assigned",
        AcctAssignment
    )
    Here replace Table 2 with the table name in which there are blanks.
    I have replicated the scenario with sample data 

    Related two tables


    Used the newly created column in the visual

    Here you can see the blanks are being replaced by Not assigned.
    Hope this works for you.

    If this helps , please accept as solution to help others find easily and a kudos would be appreciated.

    Thank you.



10 Replies

  • v-veshwara-msft's avatar
    v-veshwara-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,
    Thanks for using Microsoft Fabric Community Forum.
    Try using the below DAX to create a new column.

    Acct Assignment Order - Text (Updated) =
    VAR AcctAssignment =
        LOOKUPVALUE(
            'Table2'[Acct Assignment Order - Text],
            'Table2'[Order Key], 'Table1'[Order Key]
        )
    RETURN
    IF(
        ISBLANK(AcctAssignment) || AcctAssignment = "",
        "Not assigned",
        AcctAssignment
    )
    Here replace Table 2 with the table name in which there are blanks.
    I have replicated the scenario with sample data 

    Related two tables


    Used the newly created column in the visual

    Here you can see the blanks are being replaced by Not assigned.
    Hope this works for you.

    If this helps , please accept as solution to help others find easily and a kudos would be appreciated.

    Thank you.



    • Anonymous's avatar
      Anonymous
      Not applicable

      GREAT! It worked. But the DAX only worked for Import mode. Any idea how the DAX be working with Direct Query?

      • v-veshwara-msft's avatar
        v-veshwara-msft
        Icon for Community Support rankCommunity Support

        Glad that the DAX worked in Import mode.
        The reason it didnt work in DirectQuery is because DirectQuery limits complex DAX functions, leading to performance issues and potential query failures.
        LOOKUPVALUE can struggle in DirectQuery mode because it generates complex queries that the backend may not efficiently support.
        Use this DAX to create a new column for DirectQuery :

        Acct Assignment Order - Text (Updated) =
        IF(
            ISBLANK(RELATED('Table2'[Acct Assignment Order - Text])) || RELATED('Table2'[Acct Assignment Order - Text]) = "",
            "Not assigned",
            RELATED('Table2'[Acct Assignment Order - Text])
        )

        Hope this works.

        Thankyou.



  • Hi Anonymous , 

    What column do you want to replace with "Not assigned"? are you using dax? show us the DAX used, give more context, just to understand your problem.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      I'll be replacing Acct Assignment Order - Text field to "Not assigned". When I created the relationship, it shows blank values due to unmatched record. I tried using below DAX, but it's not working

       

      Column = IF('CVM_Acct Assignment Order - Text'[Acct Assignment Order - Text] = BLANK(),"Not assigned",'CVM_Acct Assignment Order - Text'[Acct Assignment Order - Text])
      • Bibiano_Geraldo's avatar
        Bibiano_Geraldo
        Icon for Super User rankSuper User

        Its possible to share no sensitive file to see the problem closer?

         

         

    • Uzi2019's avatar
      Uzi2019
      Icon for Community Champion rankCommunity Champion

      Hi Anonymous 

       

      Can you share the PBIX file and remove critical data from it??

       

       

  • Anonymous 

    Create a new column:

    Acct Assignment Order - Text (Updated) = 
    IF(
    ISBLANK('YourTable'[Acct Assignment Order - Text]),
    "Not assigned",
    'YourTable'[Acct Assignment Order - Text]
    )

    💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
    Cheers,
    Kedar
    Connect on LinkedIn

    • Anonymous's avatar
      Anonymous
      Not applicable

      not working. Acct Assignment Order - Text field & Purchasing Document Key is coming from different table. They are related using Order Key field. When I created the relationship, it shows blank values due to unmatched record.