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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jnail923
Frequent Visitor

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!

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
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"
    )
1.PNG
 
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
Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
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"
    )
1.PNG
 
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
Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

Use FIND or SEARCH?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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