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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
filexsundeep09
Frequent Visitor

Conditional column based to identify the possible lowest level

Experts, please someone help me with the below scenario to create the conditional column based on the lowest possible value. Below, the second column should show me whether it is Aggregator/Lowest Level Detail-based on mentioned dots.

Example: For CBL.0006412.02.01.01 it ends with .01 which is the last one and my condition should identify and show me whether it is Aggregator/Lowest Level Detail. And, if you see CBL.0006413.02.01CBL.0006413.02.02, it shows Lowest Level Detail.

 

CBL.0006412

Aggregator

CBL.0006412.01

Aggregator

CBL.0006412.02

Aggregator

CBL.0006412.02.01

Aggregator

CBL.0006412.02.01.01

Lowest level detail

CBL.0006413

Aggregator

CBL.0006413.01

Aggregator

CBL.0006413.02

Aggregator

CBL.0006413.02.01

Lowest level detail

CBL.0006413.02.02

Lowest level detail

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @filexsundeep09 

 

Use this code to add a new column to your table:

 

Column = 
VAR _NDot =
    LEN ( 'Table'[Item] )
        - ( LEN ( SUBSTITUTE ( 'Table'[Item], ".", "" ) ) + 1 )
VAR _Dot_Group =
    GROUPBY (
        SUMMARIZE (
            'Table',
            'Table'[Item],
            "AA", LEFT ( 'Table'[Item], 11 ),
            "BB",
                LEN ( 'Table'[Item] )
                    - ( LEN ( SUBSTITUTE ( 'Table'[Item], ".", "" ) ) + 1 )
        ),
        [AA],
        "CCD", MAXX ( CURRENTGROUP (), [BB] )
    )
VAR _Max_Group =
    MAXX ( FILTER ( _Dot_Group, [AA] = LEFT ( 'Table'[Item], 11 ) ), [CCD] )
RETURN
    IF ( _NDot = _Max_Group, "Lowest level detail", "Aggregator" )

 

 

Output:

VahidDM_0-1658235113386.png

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

View solution in original post

2 REPLIES 2
VahidDM
Super User
Super User

Hi @filexsundeep09 

 

Use this code to add a new column to your table:

 

Column = 
VAR _NDot =
    LEN ( 'Table'[Item] )
        - ( LEN ( SUBSTITUTE ( 'Table'[Item], ".", "" ) ) + 1 )
VAR _Dot_Group =
    GROUPBY (
        SUMMARIZE (
            'Table',
            'Table'[Item],
            "AA", LEFT ( 'Table'[Item], 11 ),
            "BB",
                LEN ( 'Table'[Item] )
                    - ( LEN ( SUBSTITUTE ( 'Table'[Item], ".", "" ) ) + 1 )
        ),
        [AA],
        "CCD", MAXX ( CURRENTGROUP (), [BB] )
    )
VAR _Max_Group =
    MAXX ( FILTER ( _Dot_Group, [AA] = LEFT ( 'Table'[Item], 11 ) ), [CCD] )
RETURN
    IF ( _NDot = _Max_Group, "Lowest level detail", "Aggregator" )

 

 

Output:

VahidDM_0-1658235113386.png

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

filexsundeep09
Frequent Visitor

Really Thanks Vahid for your quick help, you made my day. Thanks a lot again and you are Power BI & DAX expert.

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric 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.

Users online (27)