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! Learn more

Reply
rommel20
Resolver I
Resolver I

DAX Grouping (tagging)

Need help, I need to tagged record if retain or removed based on its status and it grouping

Capture.JPG

But  the rules are

 

1: For each Unit, filter out Pros records if there exists an Exec record

2: For each Unit, filter out Vacant records if there exists a Pros record

 

so if it cointain one Unit it will retain else need to use the rule above.

 

Im trying to use contains and group by but still i  got incorrect Ouput.

 

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

@rommel20,

 

You may check if RANKX Function works.

Rules (tagging) =
VAR Rnk =
    RANKX (
        CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[Property], Table1[Unit] ) ),
        SWITCH ( Table1[Status], "Exec", 1, "Pros", 2, "Vacant", 3 ),
        ,
        1
    )
RETURN
    IF ( Rnk = 1, "Record remains", "Record removed" )
Community Support Team _ Sam Zha
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

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@rommel20,

 

You may check if RANKX Function works.

Rules (tagging) =
VAR Rnk =
    RANKX (
        CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[Property], Table1[Unit] ) ),
        SWITCH ( Table1[Status], "Exec", 1, "Pros", 2, "Vacant", 3 ),
        ,
        1
    )
RETURN
    IF ( Rnk = 1, "Record remains", "Record removed" )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

its working. thanks.

prateekraina
Memorable Member
Memorable Member

Hi @rommel20,

 

Sorry, but i am not able to understand your problem. Can you re phrase what are you doing exactly?

 

Prateek Raina

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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