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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Farhana110
Frequent Visitor

DAX

Combining Conditions for Eligibility

 

 

 

Hi,

 

How to combine below three condition to form calculated column eligible in power bi 1st condition
VAR _firstindex =
MAXX (
INDEX( 1,
SUMMARIZE ( 'Closed- won_table', 'Closed-won_Table'[Lead ID], [Closed - Won_ Table'[Index] ), Order by ('closed - won _ table' [Index], ASC),
KEEP,
PartitionBY (' Closed- won _ table' [lead ID] )), 'Closed - Won_Table' [Index] ) Return
If (closed - won _ table [ Index] = _ first index, " Eligible", " ineligible" )
 
2nd condition is
VAR _Firstindex1 =
MAXX ( INDEX ( 1,
Summarize ( ' Closed - won_ table', ' Closed - won _ table ' [lead ID], ' Closed- won_Table' [Index] , ASC),
KEEP,
PARTITIONBY ( 'Closed - won_ table'[ Lead ID] )), 'Closed-won_Table' [ Index] ) Return
If ( closed won table [ index] = _firstindex1, " Eligible"," Ineligible")
 
3rd condition is
If [closed- won _table. Local currency]=0 && [closed - won _ table_ payout in USD] = 0, " ineligible, EMP not found", "eligible")
Appreciate your help in this regards, Thanks!
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Farhana110 ,

Please hvae a try.

column =
VAR _firstindex =
    MAXX (
        INDEX (
            1,
            SUMMARIZE (
                'Closed- won_table',
                'Closed-won_Table'[Lead ID],
                [Closed - Won_ Table'[Index]
            ),
            ORDERBY ( 'closed - won _ table'[Index], ASC ),
            KEEP,
            PARTITIONBY ( ' Closed- won _ table'[lead ID] )
        ),
        'Closed - Won_Table'[Index]
    )
VAR _Firstindex1 =
    MAXX (
        INDEX (
            1,
            SUMMARIZE (
                ' Closed - won_ table',
                ' Closed - won _ table '[lead ID],
                ' Closed- won_Table'[Index]
            ),
            KEEP,
            PARTITIONBY ( 'Closed - won_ table'[ Lead ID] )
        ),
        'Closed-won_Table'[ Index]
    )
RETURN
    IF (
        'closed- won _table'[Local currency] = 0
            && 'closed- won _ table'[payout in USD] = 0,
        " ineligible, EMP not found",
        IF (
            'closed- won _ table'[ Index] = _firstindex
                || 'closed- won _ table '[ index] = _Firstindex1,
            "eligible",
            "ineligible"
        )
    )

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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
Muhammad110
Advocate I
Advocate I

Try this one ;;

 

eligible =
VAR _firstindex =
MAXX (
INDEX (
1,
SUMMARIZE (
'Closed- won_table',
'Closed-won_Table'[Lead ID],
[Closed - Won_ Table'[Index]
),
ORDER BY ('closed - won _ table'[Index], ASC),
KEEP,
PARTITION BY ('Closed - won _ table'[lead ID])
),
'Closed - Won_Table'[Index]
)
VAR _Firstindex1 =
MAXX (
INDEX (
1,
SUMMARIZE (
'Closed - won_ table',
'Closed - won _ table'[lead ID],
'Closed- won_Table'[Index],
ASC
),
KEEP,
PARTITION BY ('Closed - won _ table'[Lead ID])
),
'Closed-won_Table'[Index]
)
RETURN
IF (
'Closed - won _ table'[Index] = _firstindex
&& 'Closed - won _ table'[Index] = _Firstindex1
&& 'Closed- won _table'[Local currency] = 0
&& 'Closed - won _ table_ payout in USD] = 0,
"ineligible, EMP not found",
"eligible"
)

Anonymous
Not applicable

Hi @Farhana110 ,

Please hvae a try.

column =
VAR _firstindex =
    MAXX (
        INDEX (
            1,
            SUMMARIZE (
                'Closed- won_table',
                'Closed-won_Table'[Lead ID],
                [Closed - Won_ Table'[Index]
            ),
            ORDERBY ( 'closed - won _ table'[Index], ASC ),
            KEEP,
            PARTITIONBY ( ' Closed- won _ table'[lead ID] )
        ),
        'Closed - Won_Table'[Index]
    )
VAR _Firstindex1 =
    MAXX (
        INDEX (
            1,
            SUMMARIZE (
                ' Closed - won_ table',
                ' Closed - won _ table '[lead ID],
                ' Closed- won_Table'[Index]
            ),
            KEEP,
            PARTITIONBY ( 'Closed - won_ table'[ Lead ID] )
        ),
        'Closed-won_Table'[ Index]
    )
RETURN
    IF (
        'closed- won _table'[Local currency] = 0
            && 'closed- won _ table'[payout in USD] = 0,
        " ineligible, EMP not found",
        IF (
            'closed- won _ table'[ Index] = _firstindex
                || 'closed- won _ table '[ index] = _Firstindex1,
            "eligible",
            "ineligible"
        )
    )

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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