Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

If blank dax statement

Hi, i have a column that creates some HTML out of a number of text fields. If a filed is null, I would like to return the text "no update received" instead of a blank entry. How would i amend the fol...
  • v-lid-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    We can use the following formula to meet your requirement:

     

    zzProjectDetailsHTMLConcatenate-KH-NextSteps- =
    VAR XXX =
        IF (
            ISBLANK ( 'Projects (2)'[XXX] )
                || 'Projects (2)'[XXX] = "",
            "no update received",
            'Projects (2)'[XXX]
        )
    VAR ZZZ =
        IF (
            ISBLANK ( 'Projects (2)'[ZZZ] )
                || 'Projects (2)'[ZZZ] = "",
            "no update received",
            'Projects (2)'[ZZZ]
        )
    RETURN
        "<h1>" & "TEXT FIELD 1" & "</h1>" & "<p>" & XXX & "</p>" & "<h1>" & "<hr>" & "TEXT FIELD 2" & "</h1>" & "<p>" & ZZZ & "<hr>"

     

     

     

    If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


    BTW, pbix as attached.

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.