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

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

Reply
Shruthi96
Helper III
Helper III

Dax Code for - getting unique count

Hi Friends, 

 

I am looking for the solution to get the unique count from the column list column which I have mentioned in the below snapshot.  Thanks in advance. 

 

Shruthi96_0-1648738047917.png

 

1 ACCEPTED SOLUTION
Jos_Woolley
Solution Sage
Solution Sage

Hi,

 

MyMeasure =
VAR MyValues =
    ADDCOLUMNS( 'Table', "Paths", SUBSTITUTE( [Column1], ",", "|" ) )
VAR MyTable1 =
    SELECTCOLUMNS(
        GENERATE(
            MyValues,
            ADDCOLUMNS(
                GENERATESERIES( 1, PATHLENGTH( [Paths] ) ),
                "MyPaths", TRIM( PATHITEM( [Paths], [Value], TEXT ) )
            )
        ),
        "Paths", [MyPaths]
    )
VAR MyTable2 =
    ADDCOLUMNS( MyTable1, "Rank", RANKX( MyTable1, [Paths],,, DENSE ) )
RETURN
    MAXX( MyTable2, [Rank] )

 

Regards

View solution in original post

4 REPLIES 4
Jos_Woolley
Solution Sage
Solution Sage

Hi,

 

MyMeasure =
VAR MyValues =
    ADDCOLUMNS( 'Table', "Paths", SUBSTITUTE( [Column1], ",", "|" ) )
VAR MyTable1 =
    SELECTCOLUMNS(
        GENERATE(
            MyValues,
            ADDCOLUMNS(
                GENERATESERIES( 1, PATHLENGTH( [Paths] ) ),
                "MyPaths", TRIM( PATHITEM( [Paths], [Value], TEXT ) )
            )
        ),
        "Paths", [MyPaths]
    )
VAR MyTable2 =
    ADDCOLUMNS( MyTable1, "Rank", RANKX( MyTable1, [Paths],,, DENSE ) )
RETURN
    MAXX( MyTable2, [Rank] )

 

Regards

Thank you @Jos_Woolley  It worked. 🙂

You're welcome!

Regards

Shruthi96
Helper III
Helper III

I need the solution only from DAX code. 

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.