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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
chem094
Frequent Visitor

Search final category from hierarchy table for each organization (even duplicates for each keyword)

Hi All, 

 

Could you please help me with DAX function or Powerquery to solve the below requirement? i need to have one final category for each keyword and organization group. if org & keyword is unique then need to retain the already found category in the final category column 

chem094_0-1644648835081.png

 

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @chem094 ,

 

Please create the relationship and calculated column.

 

vkkfmsft_0-1644905304861.png

Final Category = 
VAR tab =
    FILTER ( 'Table', 'Table'[Customer] = EARLIER ( 'Table'[Customer] ) )
VAR Cus =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[Category] ), tab )
VAR Index =
    CALCULATE ( MIN ( Category[Index] ), tab )
RETURN
    IF (
        Cus > 1,
        CALCULATE (
            MAX ( Category[CategoryOrder] ),
            FILTER ( Category, Category[Index] = Index )
        ),
        'Table'[Category]
    )

vkkfmsft_1-1644905399269.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

TOK
Helper II
Helper II

Hi @chem094,

 

as the category is unique per customer I would recommend to use/adjust your customer dimension by creating a new column "Category" there. It's definitly easier than finding a way to put it in a measure.

Liked this post? More Content on:
https://www.youtube.com/channel/UC2lAgCgfyLCHsRv0h-ETBWQ

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.