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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
maneschr2022
Helper II
Helper II

Sum of unique values in multiple columns

Screen Shot 2022-04-13 at 10.28.09 am.png

 Hi, I have 3 columns that I would like to sum their unique values and have a total number of users, for this example, the output should be 9, as Tom is repeated.

 

I tried to use a formula for a similar example situation  but it gave me fewer numbers for some reason.
 This is the formula that I tried: 

Count Total Users= COUNTROWS(SUMMARIZE(Table[ User Level 1],[ User Level 2]Table[ User Level 3]))

 

Thanks for your help!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture2.png

 

Total users count: =
VAR newtable =
    FILTER (
        SUMMARIZE (
            UNION (
                VALUES ( Data[UserLevel1] ),
                VALUES ( Data[UserLevel2] ),
                VALUES ( Data[UserLevel3] )
            ),
            Data[UserLevel1]
        ),
        Data[UserLevel1] <> BLANK ()
    )
RETURN
    COUNTROWS ( newtable )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture2.png

 

Total users count: =
VAR newtable =
    FILTER (
        SUMMARIZE (
            UNION (
                VALUES ( Data[UserLevel1] ),
                VALUES ( Data[UserLevel2] ),
                VALUES ( Data[UserLevel3] )
            ),
            Data[UserLevel1]
        ),
        Data[UserLevel1] <> BLANK ()
    )
RETURN
    COUNTROWS ( newtable )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Whitewater100
Solution Sage
Solution Sage

Hi:

If you don't mind using transform data and higlight the first column and unpivot others you get:

Whitewater100_0-1649811413094.png

Whitewater100_1-1649811525122.png

 

Then this measure will result in nine for the count.

User CT = DISTINCTCOUNT('Table'[Value])
 
I hope this helps!

Hi, Thanks for your help, it works fine that way is a bit of a work around with tables, so I`ll go for the DAX formula

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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