Search code examples
powerbipowerbi-desktop

Catch Error Message in PowerBI Text Enhancer Visual and return custom Message


I used the Text Enhancer by MAQ Software to display answers from a survey. I used this measure to filter the answer by a selected customer id: Is_filtered = IF(ISFILTERED(CALCULATE_DATA_PI_ICH[process_instance_id]), min(CALCULATE_DATA_PI_ICH[process_instance_id]),0) if the user has an answer selected befor in the survey everything works fine, but if this is not the case the Text Enhancer Visual returns an Query contains null values Error because my measure filtered down to an empty table. How can i avoid this and print for example "No answer"


Solution

  • You could try this to avoid blank values :

    Is_filtered = 
    VAR Result = IF(ISFILTERED(CALCULATE_DATA_PI_ICH[process_instance_id]), min(CALCULATE_DATA_PI_ICH[process_instance_id]),0)
    RETURN IF(ISBLANK(Result), "No answer", Result)
    

    If the VAR returns an empty table, it will return "No answer" instead and should also avoid the "Query contains null values" error