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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
xad
New Member

IF(string=value) only validates on 1 value but I want an OR in the value to be counted

I have a text field that has a the value max-age=63072000;includeSubdomains and sometimes it is max-age=63072000;includeSubdomains; preload
I want to count together the max-age=63072000;includeSubdomains and the max-age=63072000;includeSubdomains; preload as okay. How can I do that, I have 

HSTS_OKAY = IF(TRIM('Scan_Strict-Transport-Security'[Scan.response_headers.strict-transport-security])=LOWER("max-age=63072000; includeSubdomains"),"HSTS Good","HSTS is NOT OKAY")
But that leaves the ones with preload as NOT OKAY which must be counted as good
2 ACCEPTED SOLUTIONS
Sergii24
Super User
Super User

Hi @xad, you can use Containsstring() fucntion (CONTAINSSTRING function (DAX) - DAX | Microsoft Learn )

 

HSTS_OKAY = 
    IF(
        CONTAINSSTRING( 'Table'[Value], "max-age=63072000;includeSubdomains" ) = TRUE(),
        "HSTS Good",
        "HSTS is NOT OKAY"
    )

 


This will give you the following result:

Sergii24_0-1727875572564.png

 

Good luck!

View solution in original post

xad
New Member

Thank You Sergii24 !! I will try

View solution in original post

2 REPLIES 2
xad
New Member

Thank You Sergii24 !! I will try

Sergii24
Super User
Super User

Hi @xad, you can use Containsstring() fucntion (CONTAINSSTRING function (DAX) - DAX | Microsoft Learn )

 

HSTS_OKAY = 
    IF(
        CONTAINSSTRING( 'Table'[Value], "max-age=63072000;includeSubdomains" ) = TRUE(),
        "HSTS Good",
        "HSTS is NOT OKAY"
    )

 


This will give you the following result:

Sergii24_0-1727875572564.png

 

Good luck!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.