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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
VamshiKumar
Frequent Visitor

DAX Measure for skipping rows based on stages

Hi Team,

 

I have been stuck at a Dax formula and couldn't solve it after spending a considerable amount of time.

I request you to please help with this.

 

My Table would look like below.

 

Candidate IDStatusFeeCTCRevenueDate
1Offered10%1000001000001-01-2021
1Accepted10%1000001000002-01-2021
1Joined10%1000001000003-01-2021
1Abscond10%1000001000004-01-2021
2Offered20%1000002000001-01-2021
2Accepted20%1000002000002-01-2021
2Joined20%1000002000003-01-2021

 

I would like to calculate revenue at joined stage of a candidate and if his stage is abscond it shouldnt calculate revenue and sholud return zero. Canidate goes from offered stage to joined stage and we are calculating revenue for joined people but couldnt get logic to exclude people who are absconded.

 

Thanks in advance. Any help is much appreciated.

 

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@VamshiKumar  you can use a measure like this

Measure2 =
CALCULATE (
    SUM ( 'Table 1'[Revenue] ),
    EXCEPT (
        CALCULATETABLE (
            SUMMARIZE ( 'Table 1', 'Table 1'[Candidate ID] ),
            'Table 1'[Status] IN { "Joined", "Abscond" }
        ),
        SUMMARIZE (
            EXCEPT (
                CALCULATETABLE (
                    SUMMARIZE ( 'Table 1', 'Table 1'[Candidate ID], 'Table 1'[Status] ),
                    'Table 1'[Status] IN { "Joined", "Abscond" }
                ),
                CALCULATETABLE (
                    SUMMARIZE ( 'Table 1', 'Table 1'[Candidate ID], 'Table 1'[Status] ),
                    'Table 1'[Status] IN { "Joined" }
                )
            ),
            'Table 1'[Candidate ID]
        )
    ),
    FILTER ( VALUES ( 'Table 1'[Status] ), 'Table 1'[Status] = "Joined" )
)

 

smpa01_0-1641228529173.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@VamshiKumar not sure what the final output you are looking for, but here is a shorter version of the measure:

 

Measure 2 = 
VAR __isAbscond = CALCULATE ( COUNTROWS ( Rev ), ALL ( Rev ), VALUES ( Rev[Candidate ID] ), Rev[Status] = "Abscond" )
RETURN IF ( __isAbscond == BLANK (), CALCULATE ( SUM ( Rev[Revenue] ), Rev[Status] = "Joined" ) )

 

Follow us on LinkedIn and subscribe to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

smpa01
Super User
Super User

@VamshiKumar  you can use a measure like this

Measure2 =
CALCULATE (
    SUM ( 'Table 1'[Revenue] ),
    EXCEPT (
        CALCULATETABLE (
            SUMMARIZE ( 'Table 1', 'Table 1'[Candidate ID] ),
            'Table 1'[Status] IN { "Joined", "Abscond" }
        ),
        SUMMARIZE (
            EXCEPT (
                CALCULATETABLE (
                    SUMMARIZE ( 'Table 1', 'Table 1'[Candidate ID], 'Table 1'[Status] ),
                    'Table 1'[Status] IN { "Joined", "Abscond" }
                ),
                CALCULATETABLE (
                    SUMMARIZE ( 'Table 1', 'Table 1'[Candidate ID], 'Table 1'[Status] ),
                    'Table 1'[Status] IN { "Joined" }
                )
            ),
            'Table 1'[Candidate ID]
        )
    ),
    FILTER ( VALUES ( 'Table 1'[Status] ), 'Table 1'[Status] = "Joined" )
)

 

smpa01_0-1641228529173.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors