Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
ocmarketing
Regular Visitor

Creating a Flag

Very new to using PowerBi I was looking for a video that demonstrated how to create a flag on certain data. For example "bad" email addresses. Not sure if this gives enough context - hoping someone may be able to assist. Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ocmarketing ,

 

Please refer to this thread:

let
    IsValidEmail = (input as text) =>
    let
        name = Text.BeforeDelimiter(input,"@",{0,RelativePosition.FromEnd}),
        ext = Text.AfterDelimiter(input,".",{0,RelativePosition.FromEnd}),
        domain = Text.BetweenDelimiters(input,name&"@","."&ext),
        return =
            Text.Length(name) > 0 and
            Text.Length(domain) > 0 and
            Text.Length(ext) > 1 and Text.Length(ext) < 6 and
            name = Text.Select(name, {"a".."z","A".."Z","0".."9","_","-","."}) and
            domain = Text.Select(domain, {"a".."z","A".."Z","0".."9","_","-","."}) and
            ext = Text.Select(ext, {"a".."z","A".."Z"})
    in
        return
in
    IsValidEmail

vcgaomsft_0-1720588306598.png

You can further mark up these values by using conditional formatting colors. If I have misunderstood your question or you need further help please feel free to contact me.

Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @ocmarketing ,

 

Please refer to this thread:

let
    IsValidEmail = (input as text) =>
    let
        name = Text.BeforeDelimiter(input,"@",{0,RelativePosition.FromEnd}),
        ext = Text.AfterDelimiter(input,".",{0,RelativePosition.FromEnd}),
        domain = Text.BetweenDelimiters(input,name&"@","."&ext),
        return =
            Text.Length(name) > 0 and
            Text.Length(domain) > 0 and
            Text.Length(ext) > 1 and Text.Length(ext) < 6 and
            name = Text.Select(name, {"a".."z","A".."Z","0".."9","_","-","."}) and
            domain = Text.Select(domain, {"a".."z","A".."Z","0".."9","_","-","."}) and
            ext = Text.Select(ext, {"a".."z","A".."Z"})
    in
        return
in
    IsValidEmail

vcgaomsft_0-1720588306598.png

You can further mark up these values by using conditional formatting colors. If I have misunderstood your question or you need further help please feel free to contact me.

Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

NaveenGandhi
Super User
Super User

Hi @ocmarketing 

Please provide sample file and sample expected output to understand the problem better.

Regards,
NG

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.