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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply

Help for VLook up type of rquirement

Hi Power BI Gurus,

Refering below image I am looking for a DAX formula for creating a column that gives the result "Converted") if there are two specific values "1.2 Design Checking" & 13.1 Inspection associated with Project ID, for example, project id 103176 has Design Certification & Inspection Please help me create that?

Screenshot 2021-04-13 000730.png

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @ramhariessentia ,

You could try the following measure:

test = 
VAR test3 =
    IF (
        CALCULATE (
            COUNT ( 'Sample'[Project ID] ),
            FILTER (
                ALL ( 'Sample' ),
                'Sample'[Fee Name] = "13.1 Inspection"
                    && 'Sample'[Project ID] = MAX ( 'Sample'[Project ID] )
            )
        ) >= 1,
        1,
        0
    )
VAR test2 =
    IF (
        CALCULATE (
            COUNT ( 'Sample'[Project ID] ),
            FILTER (
                ALL ( 'Sample' ),
                'Sample'[Fee Name] = "1.2 Design Checking"
                    && 'Sample'[Project ID] = MAX ( 'Sample'[Project ID] )
            )
        ) >= 1,
        1,
        0
    )
RETURN
    IF (
        test2 = 1
            && test3 = 1,
        "1.2 Design Checking&&13.1 Inspection",
        MAX ( 'Sample'[Fee Name] )
    )

Final you will get the below:

v-luwang-msft_0-1619671706238.png

 

View solution in original post

4 REPLIES 4
v-luwang-msft
Community Support
Community Support

Hi @ramhariessentia ,

You could try the following measure:

test = 
VAR test3 =
    IF (
        CALCULATE (
            COUNT ( 'Sample'[Project ID] ),
            FILTER (
                ALL ( 'Sample' ),
                'Sample'[Fee Name] = "13.1 Inspection"
                    && 'Sample'[Project ID] = MAX ( 'Sample'[Project ID] )
            )
        ) >= 1,
        1,
        0
    )
VAR test2 =
    IF (
        CALCULATE (
            COUNT ( 'Sample'[Project ID] ),
            FILTER (
                ALL ( 'Sample' ),
                'Sample'[Fee Name] = "1.2 Design Checking"
                    && 'Sample'[Project ID] = MAX ( 'Sample'[Project ID] )
            )
        ) >= 1,
        1,
        0
    )
RETURN
    IF (
        test2 = 1
            && test3 = 1,
        "1.2 Design Checking&&13.1 Inspection",
        MAX ( 'Sample'[Fee Name] )
    )

Final you will get the below:

v-luwang-msft_0-1619671706238.png

 

amitchandak
Super User
Super User

@ramhariessentia , Based on what I got, Try a new column like

if( calculate(distinctCOUNT([Fee Name]), filter(Table, [projectID] =earlier([projectID]) && [Fee Name] in {"1.2 Design Checking" , "13.1 Inspection (L1)"}))+0 =2, 1,0)

I am getting following syntax errorScreenshot 2021-04-13 103647.png

ramhariessentia_0-1618277840829.png

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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