Forum Discussion

jnail923's avatar
jnail923
Frequent Visitor
8 years ago
Solved

DAX Assistance Needed

Hello - I need guidance on creating a formula.

I need to show rows with same Line # and specific parts #s as configured or not configured.

Example: If line 1.1 contains part #s 0678001000, 0678003000, 0678006000, 0678007000 and another Part with a "*" that would equal "configured". If line 1.1 contained one of the four part #s above, but no "*" part, then it would be "not configured"

 
Configured Example: If Line 1.1 Contains Part # 0678003000 & Part # with "*", the Configued

Order Number       LINE    PART                       PART_DESCRIPTION
21018225                1.1    0678003*7461566    PKG, SWITCHPOINT INFINITY 3 LITE
21018225                1.1    0678003000             PKG, SWITCHPOINT INFINITY 3 LITE

 

Thank you!

  • Hi jnail923,

     

    You could create a calculated column:

    Check isConfigured =
    VAR temp1 =
        NOT ( ISERROR ( FIND ( "0678001000", TestData[PART] ) ) )
    VAR temp2 =
        NOT ( ISERROR ( FIND ( "0678003000", TestData[PART] ) ) )
    VAR temp3 =
        NOT ( ISERROR ( FIND ( "0678006000", TestData[PART] ) ) )
    VAR temp4 =
        NOT ( ISERROR ( FIND ( "0678007000", TestData[PART] ) ) )
    VAR temp5 =
        NOT ( ISERROR ( FIND ( "*", TestData[PART] ) ) )
    RETURN
        IF (
            ( temp1 || temp2
                || temp3
                || temp4 )
                && temp5 = TRUE (),
            "Configured",
            "Not Configured"
        )
     
    Then, when you add above fields into visual, you can filter out rows where "Check isConfigured" equals "Not Configured" via slicer or "visual level filters".
     
    Best regards,
    Yuliana Gu

2 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi jnail923,

     

    You could create a calculated column:

    Check isConfigured =
    VAR temp1 =
        NOT ( ISERROR ( FIND ( "0678001000", TestData[PART] ) ) )
    VAR temp2 =
        NOT ( ISERROR ( FIND ( "0678003000", TestData[PART] ) ) )
    VAR temp3 =
        NOT ( ISERROR ( FIND ( "0678006000", TestData[PART] ) ) )
    VAR temp4 =
        NOT ( ISERROR ( FIND ( "0678007000", TestData[PART] ) ) )
    VAR temp5 =
        NOT ( ISERROR ( FIND ( "*", TestData[PART] ) ) )
    RETURN
        IF (
            ( temp1 || temp2
                || temp3
                || temp4 )
                && temp5 = TRUE (),
            "Configured",
            "Not Configured"
        )
     
    Then, when you add above fields into visual, you can filter out rows where "Check isConfigured" equals "Not Configured" via slicer or "visual level filters".
     
    Best regards,
    Yuliana Gu